好像找到一個相關的
但不能用?
需要在web request 等地方設定嗎?
或是那些前置作業呢?
https://gist.github.com/syusuke9999/feebe00f4ddf5b40459d28a24f0a33ab
void POST_LINE_Message_To_Server(string message) | |
{ | |
char message_data[], result[]; | |
string RequestMethod = "POST"; | |
string headers = "Content-Type: application/x-www-form-urlencoded" + "\r\n"; | |
headers += "Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + "\r\n"; | |
int timeout = 10000; | |
string result_headers = NULL; | |
string message_text = "message="; | |
message_text += message; | |
StringToCharArray(message_text,message_data,0, StringLen(message_text)); | |
int res = WebRequest(RequestMethod, END_POINT_URL, headers, timeout, message_data, result, result_headers); | |
if(res==-1) | |
{ | |
Print("Error in WebRequest. Error code =",GetLastError()); | |
} | |
else | |
{ | |
string result_text = StringConcatenate(CharArrayToString(result,0,ArraySize(result))); | |
int replaced = StringReplace(result_text,"\"",""); | |
} | |
return; | |
} |
- 使用mql4的简单POST/GET HttpRequest
- 初学者的问题 MQL4 MT4 MetaTrader 4
- 新人对MQL4和MQL5的任何问题,对算法和代码的帮助和讨论
Forum on trading, automated trading systems and testing trading strategies
When you post code please use the CODE button (Alt-S)!