Login Page - Create Account

Support Board


Date/Time: Thu, 25 Apr 2024 07:37:02 +0000



MakeHTTPPOSTRequest to send JSON body

View Count: 910

[2020-11-30 15:34:21]
kam2001 - Posts: 65
Hi,

Is it possible to make this method (MakeHTTPPOSTRequest) to send JSON (application/json) as part of the body instead of application/x-www-form-urlencoded ?
and also how can we retreive response headers from sc.HTTPResponse.

Thanks,
Kam
Date Time Of Last Edit: 2020-12-01 10:48:12
[2020-12-01 19:02:02]
Sierra Chart Engineering - Posts: 104368
We will have to look at this when we can but we really recommend just doing these HTTP requests outside of the ACSIL interface. Have a look at using curl.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2020-12-02 14:29:05]
kam2001 - Posts: 65
Thanks, i am not sure what you mean by using Curl. I understand curl is way to transfer data and can also be used for http protocol, are you saying curl is supported in ACSIL interface.
My set up is that i've got an external broker where i need to send json body and retrieve key from response headers to make any subsequent calls. Currently i am making a call from sierra to my own app which accepts application/x-www-form-urlencoded from sierra and than converts it to json and sends a curl request to broker. The reason for this request from yourself was so i can cut out the middleman (my app) and make a call straight from sierra by sending json.
Date Time Of Last Edit: 2020-12-02 14:30:52
[2020-12-30 22:18:25]
Sierra_Chart Engineering - Posts: 14076
There simply is no support in ACSIL to access HTTP headers but there is a way to specify headers with the request by using this function:

int (SCDLLCALL* MakeHTTPPOSTRequest)(const SCString& URL, const SCString& POSTData, const n_ACSIL::s_HTTPHeader* Headers, int NumberOfHeaders);

We will be sure to prepare some documentation for this to explain how it is used.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2020-12-30 22:18:47

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account