Page 1 of 1

Is it possible to set HTTP headers via JadeHTTPConnection

Posted: Mon Nov 20, 2017 10:16 am
by David D
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 '
'

Re: Is it possible to set HTTP headers via JadeHTTPConnection

Posted: Wed Dec 20, 2017 2:46 pm
by baza
Hi,

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

Cheers, Baz

Re: Is it possible to set HTTP headers via JadeHTTPConnection

Posted: Thu Dec 21, 2017 2:05 pm
by suzuki1100
Try the Jade method (protected) _httpHeaderAdd

Re: Is it possible to set HTTP headers via JadeHTTPConnection

Posted: Thu Dec 21, 2017 3:37 pm
by baza
thanks, i'll give it a try..I got a working solution using a TCPIpConnection for now..

Re: Is it possible to set HTTP headers via JadeHTTPConnection

Posted: Thu Dec 21, 2017 5:44 pm
by suzuki1100
If JadeHTTPConnection doesnt give you all you need its a class wrapper around Microsoft_WinHTTP_Services.
We used the Microsoft_WinHTTP_Services activex directly