URL Address

 

I get an error message saying to add the URL address to Experts, but I did add it.  Why would I get the error message when I did add it already?

 
Thomas Bradley Butler: I get an error message saying to add the URL address to Experts, but I did add it.  Why would I get the error message when I did add it already?

just add *** to url tab, do not use http or https or www. and try

 
Arpit T #:

just add myfxbook.com to url tab, do not use http or https or www. and try

wont work because it is an api 

 
Arpit T #:

just add myfxbook.com to url tab, do not use http or https or www. and try

doesnt matter what address I put in, it still tells me to add it

 
Thomas Bradley Butler #:

doesnt matter what address I put in, it still tells me to add it

search for code where you find string "Add the address" and troubleshoot it

Thomas Bradley Butler #:

wont work because it is an api 

then how mine is working? It works 

I work with API and its working fine without using www or https:// or http:// so it seems problem in your code

 
Arpit T #:

just add myfxbook.com to url tab, do not use http or https or www. and try

you have to add http

 
Thomas Bradley Butler: I get an error message saying to add the URL address to Experts, but I did add it.  Why would I get the error message when I did add it already?

Please note, that accessing that 3rd party service will fail with MT4, because they are filtering out the default "user-agent" that MT4 presents.

Also, the session ID for accessing the "Community Outlook" will expire after a while and you will need to update it regularly.

In other words, your current code needs to be fixed or refactored in order for it to work successfully with MT4.

 

Also, please don't mention the 3rd party, because...

Discussions, recommendations or suggestions for 3rd party products and services is not allowed on the forum.

I have edited the text and images of some of the posts to obfuscate references to 3rd parties.

 
Arpit T #:

search for code where you find string "Add the address" and troubleshoot it

then how mine is working? It works 

I work with API and its working fine without using www or https:// or http:// so it seems problem in your code

it only gave me the error when I change the web request

// Function to perform HTTP request
int WebRequest(
    const string method,
    const string url,
    const string headers,
    int timeout,
    const char data[],
    string &result
)
{
    if (timeout <= 0)
    {
        Print("WebRequest timeout reached. Aborting request for URL:", url);
        return -1; // or handle the timeout error accordingly
    }

    Print("Making request to URL:", url);

    int request = WebRequest(method, url, headers, --timeout, data, result);

    if (request == -1)
    {
        Print("Error in MyWebRequest. Error code =", GetLastError());
    }

    // Print the response data for debugging
    Print("Response data:", result);

    return request;
}
 
Thomas Bradley Butler #: it only gave me the error when I change the web request
The function "WebRequest" is an internal function and reserved. Don't try to redefine it, much less create an infinite recursion.
WebRequest - Common Functions - MQL4 Reference
WebRequest - Common Functions - MQL4 Reference
  • docs.mql4.com
WebRequest - Common Functions - MQL4 Reference
 
Fernando Carreiro #: The function "WebRequest" is an internal function and reserved. Don't try to redefine it, much less create an infinite recursion.

I did that originally, but it did not make any request.  Either it times out making the url not work but increasing it, it will continue to request and then throw an error stack overflow