EA compilation Error

 

Hello Everyone !
I'am trying to compile an EA on my computer, running python. I have this. can somebody help?

//+------------------------------------------------------------------+
//| Timer function                                                   |
//+------------------------------------------------------------------+
void OnTimer()
{
   //--- here we'll send the POST request to the server
   string httpMethod = "POST";
   string url = "http://localhost:5000/receive_data";
   string headers = "Content-Type: application/json\r\n";
   string postData = "{\"key\": \"value\"}";
   char post[200]; // Large enough to hold your data
   char result[2000]; // Large enough to hold the response
   char resultHeaders[2000]; // Large enough to hold the response headers
   int timeout = 5000; // Timeout in milliseconds (5 seconds)
   int res;
   int resultLength = 0; // Initialize resultLength
   // Initialize the post array with your JSON data
   StringToCharArray(postData, post, StringLen(postData));
   // Make the WebRequest call
   res = WebRequest(
     httpMethod,
     url,
     headers,
     post,
     StringLen(postData), // Data size
     result,
     resultLength,
     resultHeaders,
     timeout
   );
   // Check the result
   if(res > 0)
   {
      // Successfully received a response from the server
      string response = CharArrayToString(result, 0, resultLength);
      Print("Received response from the server: ", response);
   }
   else
   {
      // There was an error sending the request
      Print("Error sending request: ", GetLastError());
   }
}
//+------------------------------------------------------------------+

File attachments corrected by moderator
Files:
DashALRI.mq4  2 kb
[Deleted]  
Your topic has been moved to the section: MQL4 and MetaTrader 4
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
Forum rules and recommendations
Forum rules and recommendations
  • 2023.03.12
  • www.mql5.com
Each language has its own forum, and it is therefore forbidden to communicate in any language other than that of the forum in question...
[Deleted]  

The error is telling you that you are not supplying the correct parameter count or data-type and shows you the two options.

Please read the documentation — WebRequest - Common Functions - MQL4 Reference.