Doubt in WebRequest()

Back to topics list To post a new topic, please log in or register
vkarthikeyenv 2016.08.16 20:14

I would like to send user id and password to a website and validate it, and in response I would like to get user account no to validate in the code.


string str="Login="+login+"&Password="+password;

   //--- Create the body of the POST request for authorization


//--- Resetting error code


//--- Authorization request



can anyone let me know where the problem is?  I am getting error 4060

Ovo 2016.08.16 21:33 #
You cannot invoke some functions from an indicator.
FMIC 2016.08.16 21:57 #
vkarthikeyenv: ... can anyone let me know where the problem is?  I am getting error 4060

Before posting, search and read the documentation!


The WebRequest() function is synchronous, which means its breaks the program execution and waits for the response from the requested server. Since the delays in receiving a response can be large, the function is not available for calls from the indicators, because indicators run in a common thread shared by all indicators and charts on one symbol. Indicator performance delay on one of the charts of a symbol may stop updating of all charts of the same symbol.

The function can be called only from Expert Advisors and scripts, as they run in their own execution threads. If you try to call the function from an indicator, GetLastError() will return error 4060 — "Function is not allowed for call".


Back to topics list  

To add comments, please log in or register