Hi,
The exante platform has its own http api and I want to send an http request using the language mql4.
For example, in python, a simple request for the get method
requests.get(url = "https://api-demo.exante.eu/md/1.0/symbols/AAPL.NASDAQ", auth = ("<application id>: <access key>"))
I need to write this code in mql4,here with url arguments everything is clear, here is the problem with the auth argument, where should I write <application id>: <access key>
do they state in their API that the application id should go in the request header ? (probably)
do they state in their API that the application id should go in the request header ? (probably)
They only say, that every request should be attributed with Authorization header and bearer token issued for your API user and valid at the moment of request.
Basic http authentication is used with access key as password and application ID (not client ID) as username.
They only say, that every request should be attributed with Authorization header and bearer token issued for your API user and valid at the moment of request.
Basic http authentication is used with access key as password and application ID (not client ID) as username.
So you get your answer, you need to add a header with WebRequest, the credentials need to be Base64 encoded.
- en.wikipedia.org
Таким образом, вы получите свой ответ, вам нужно добавить заголовок с WebRequest, учетные данные должны быть в кодировке Base64.
Thanks, I write below code
but can't connect successfully. Where I made a mistake ?
// <application id> = 1eab640c-8798-43b3-9fc2-f8deb990a62f // <access key> = lxXig0zIODcGncXeeeVn // To enable access to the server, I add URL "https://api-demo.exante.eu/md/1.0/symbols/AAPL.NASDAQ" int res; char post[], result[]; string headers = "Login=1eab640c-8798-43b3-9fc2-f8deb990a62f&Password=lxXig0zIODcGncXeeeVn"; res = WebRequest("GET", "https://api-demo.exante.eu/md/1.0/symbols/AAPL.NASDAQ", NULL, NULL, 0, post, 0, result, headers); Print(res); // show -1
Thanks, I write below code
but can't connect successfully. Where I made a mistake ?
The mistake is on the lack of Base64 Encryption on the credentials
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
The exante platform has its own http api and I want to send an http request using the language mql4.
For example, in python, a simple request for the get method
requests.get(url = "https://api-demo.exante.eu/md/1.0/symbols/AAPL.NASDAQ", auth = ("<application id>: <access key>"))
I need to write this code in mql4,here with url arguments everything is clear, here is the problem with the auth argument, where should I write <application id>: <access key>