HTTP POST REST API call from AFL code

I am new to AFL programming. I am currently stuck with a problem in which I have to call a HTTP POST REST API and send OHLC datas for couple of previous bars from my AFL code. I see only InternetReadString() is supported to GET data, but unable to find any AFL API to post data back to server. I could not find any such solution in forum too. I am wondering how to solve this problem, does anybody has any idea or come across any such problem before.

Only GET requests (which also allow to send data to the server, via name=value pairs in query string) are supported.

UPDATE: Starting from AmiBroker version 6.30 it supports POST requests as well (http://www.amibroker.com/guide/afl/internetpostrequest.html)

1 Like

Sorry, this just got my attention and thought I would ask a related question.

Can AB serve up data requests from an open instance and DB loaded, either on our home network or out to the internet with this or other method? Similar to running a node.js? An example would be a outside query from a local network running application or application over the internet calls for data on a symbol contained in AB et al.

Just thinking.
-S

AmiBroker does not have internet server built-in inside, if that is what you are asking. You can use 3rd party server which could make calls to OLE. That would be one possibility.

Interesting. Thank you Tomasz. :+1:

You can use JScript to call any Post api. And you can use JScript in AFL with below code -

EnableScript("jscript");
<%
//..... your JScript code here.....
%>

It is worth noting this function in newer versions 6.30+ RFC: InternetPostRequest

1 Like