The website engineer gave me the following information:
URL:http://ea.takeasy.tech/api/ea/accounts
Method:GET
Headers:Content-Type: application/json\r\nAuthorization: Bearer {API Get Token}
(Token in the code, Token is only valid for 24 hours. After that time, I will update the token again.)
I print the "res" value
But keep showing -1, it can’t show 200 successfully.
What is the problem?
Thank you for your help ~
My Code:
The screenshot below is the query result using "Postman" software, which can be queried normally.
Refer to:
https://www.mql5.com/en/docs/network/webrequest
To use the WebRequest() function, add the addresses of the required servers in the list of allowed URLs in the "Expert Advisors" tab of the "Options" window.
Server port is automatically selected on the basis of the specified protocol - 80 for "http://" and 443 for "https://".
- www.mql5.com
Refer to:
https://www.mql5.com/en/docs/network/webrequest
To use the WebRequest() function, add the addresses of the required servers in the list of allowed URLs in the "Expert Advisors" tab of the "Options" window.
Server port is automatically selected on the basis of the specified protocol - 80 for "http://" and 443 for "https://".
Hi Soewono Effendi~
[add the addresses of the required servers in the list of allowed URLs in the "Expert Advisors" tab of the "Options" window.]
I have added the URL later, it is currently showing 500
How do I deal with the next step?
Thank you~
Hi Soewono Effendi~
[add the addresses of the required servers in the list of allowed URLs in the "Expert Advisors" tab of the "Options" window.]
I have added the URL later, it is currently showing 500
How do I deal with the next step?
Thank you~
what do you mean by "showing 500" ?
Hi Soewono Effendi~
I have found a solution
Thank you!
string headers= "Content-Type: application/json\r\nAuthorization: Bearer " + token;
string token= {Your Token}; int res; string method= "GET"; string url= "http://ea.takeasy.tech/api/ea/accounts"; string headers= "Content-Type: application/json\r\nAuthorization: Bearer " + token; int timeout= 0; char data[]; char results[]; string result_headers= ""; ResetLastError(); res= WebRequest(method,url,headers,timeout,data,results,result_headers); Print("res===" + IntegerToString(res));
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
The website engineer gave me the following information:
URL:http://ea.takeasy.tech/api/ea/accounts
Method:GET
Headers:Content-Type: application/json\r\nAuthorization: Bearer {API Get Token}
(Token in the code, Token is only valid for 24 hours. After that time, I will update the token again.)
I print the "res" value
But keep showing 500, it can’t show 200 successfully.
What is the problem?
Thank you for your help ~
My Code:
The screenshot below is the query result using "Postman" software, which can be queried normally.