Error in WebRequest. Error code =5200

 
 string cookie = NULL, headers;
 // response = NULL;
  bool sucess = false;
  char post[], resultReq[];
  string result;
  int res;
  string mainURL1 = "http://localhost:8080/Jatin_Team/index.jsp?action=";
 
  //--- to enable access to the server, you should add URL "https://www.google.com/finance"
  //--- in the list of allowed URLs (Main Menu->Tools->Options, tab "Expert Advisors"):
  string google_url = "";
  
    google_url = "http://localhost:8080/Jatin_Team/index.jsp";
  //--- Reset the last error code
  ResetLastError();
  //--- Loading a html page from Google Finance
  int timeout = 15000; //--- Timeout below 1000 (1 sec.) is not enough for slow Internet connection
  res = WebRequest("GET", google_url, cookie, NULL, timeout, post, 0, resultReq, headers);


HI All,


I tried above code with Allow webrequest but i am getting  Error in WebRequest. Error code  =5200

but if i try for different url other than localhost it works file like.

I searched for different post and forums but it didn't solved.


 
Jatin Patel:


HI All,


I tried above code with Allow webrequest but i am getting  Error in WebRequest. Error code  =5200

but if i try for different url other than localhost it works file like.

I searched for different post and forums but it didn't solved.


https://www.mql5.com/en/docs/constants/errorswarnings/errorcodes

 

You can not specify a port 8080 and only use port 80 http or port 443 for https.


Please read the documentation: https://www.mql5.com/en/docs/network/webrequest

Documentation on MQL5: Common Functions / WebRequest
Documentation on MQL5: Common Functions / WebRequest
  • www.mql5.com
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://". The WebRequest() function is synchronous, which means its breaks the...
 
 
@Marco vd Heijden
Marco vd Heijden:

You can not specify a port 8080 and only use port 80 http or port 443 for https.


Please read the documentation: https://www.mql5.com/en/docs/network/webrequest

I have a link with 6868 port :(

How to use this port? thanks

Reason: