Is it possible to set HTTP headers via JadeHTTPConnection

For questions and postings not covered by the other forums
David D
Posts: 8
Joined: Wed Nov 08, 2017 2:50 pm

Is it possible to set HTTP headers via JadeHTTPConnection

Postby David D » Mon Nov 20, 2017 10:16 am

The following code works except I need to pass an authrorization header, is it possible to pass/set it on the connection class?

vConnection.configureFNLProxy();

vConnectionString := "/services/v0.3/companies-office/ppsr/financing-statements/CtFMqJYEfO7qsYRZDm_0MMEwn20a";

result := vConnection.getHttpPageBinary(JadeHTTPConnection.Verb_GET, "https://sandbox.api.business.govt.nz", vConnectionString, data, "application/json").ansiToString();

status := vConnection.queryStatusCode();

e.g. and example using curl

curl --request GET \
--url 'https://sandbox.api.business.govt.nz/se ... _0MMEwn20a?=&=' \
--header 'authorization: Bearer 48c23a5b3783454b1e25818efda1bb31' \
--header 'content-type: application/json' \
--data '
'

baza
Posts: 3
Joined: Wed Dec 20, 2017 2:44 pm

Re: Is it possible to set HTTP headers via JadeHTTPConnection

Postby baza » Wed Dec 20, 2017 2:46 pm

Hi,

Did you make any progress on this ?
I have a similar requirement now....

Cheers, Baz

User avatar
suzuki1100
Posts: 29
Joined: Tue Nov 24, 2009 12:00 pm
Location: Auckland

Re: Is it possible to set HTTP headers via JadeHTTPConnection

Postby suzuki1100 » Thu Dec 21, 2017 2:05 pm

Try the Jade method (protected) _httpHeaderAdd

baza
Posts: 3
Joined: Wed Dec 20, 2017 2:44 pm

Re: Is it possible to set HTTP headers via JadeHTTPConnection

Postby baza » Thu Dec 21, 2017 3:37 pm

thanks, i'll give it a try..I got a working solution using a TCPIpConnection for now..

User avatar
suzuki1100
Posts: 29
Joined: Tue Nov 24, 2009 12:00 pm
Location: Auckland

Re: Is it possible to set HTTP headers via JadeHTTPConnection

Postby suzuki1100 » Thu Dec 21, 2017 5:44 pm

If JadeHTTPConnection doesnt give you all you need its a class wrapper around Microsoft_WinHTTP_Services.
We used the Microsoft_WinHTTP_Services activex directly


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 10 guests

cron