WebRequest broken in build 1860? - page 2

To add comments, please log in or register
Alain Verleyen
40390
Alain Verleyen  
Maximiliano Salvatti:

I use GetLastError(), but I received 0, not a code error.

When my MT5 stay in use durant the day, and I execute webrequest, sometimes I received this message:


<html><head><title>Request Rejected</title></head><body>The requested URL was rejected. If you think this is an error, please contact the webmaster. <br><br>Your support ID is: 5009239298707147011</body></html>


This message is returned for me, and the function webrequest, don´t works.

I must close and reopen my MT5, after this this works.


Do you have any idea for this problem? What I can do for easy debug?


Thanks.

This has nothing to do with the topic. The MT5 bug was fixed in 1880 (I think).

Your problem is related to the site your are dealing with.

Maximiliano Salvatti
70
Maximiliano Salvatti  
Alain Verleyen:

This has nothing to do with the topic. The MT5 bug was fixed in 1880 (I think).

Your problem is related to the site your are dealing with.

Ok, but the site is simple, just check.


The problem only occurs after an open MT5 time, usually when I change the parameters and the function is executed in OnInit or when I add a theft to the graph where OnInit is executed.


I close and open the MT5 and it returns to normal.


Is there a buffer I need to delete?


On the side of the site, is there anything I can do?


There is another topic or material that I can study about Webrequest, because I did not find anything.


I'm using build 1881.


If you can guide me, I'm very grateful.

Alain Verleyen
40390
Alain Verleyen  
Maximiliano Salvatti:

Ok, but the site is simple, just check.

Check what ? You didn't provide any link or code.

You got a reply from the site saying your url was rejected. It's not an MT5 or WebRequest issue, it's either a bug in your code or an issue with the site.

Maximiliano Salvatti
70
Maximiliano Salvatti  
Alain Verleyen:

Check what ? You didn't provide any link or code.

You got a reply from the site saying your url was rejected. It's not an MT5 or WebRequest issue, it's either a bug in your code or an issue with the site.

I use this in MT5

          string url="http://www.mysite.com/api.asp?check1=987588"; 

            res=WebRequest("GET",url,cookie,NULL,50,post,0,result,headers); 
            if(res == -1) 
               {

Alert("Error", GetLastError());

               }

            else
               {
                  response=CharArrayToString(result,0,-1,CP_UTF8);
                  u_sep = StringGetCharacter(sep,0);
                  size = StringSplit(response,u_sep,dados);
                  if (size > 0)
                     {
                        if (ArraySize(dados) < 7)  THIS POINT I HAVE ERROR
                     {
                        Alert("Error: ",GetLastError()," Res: ",res);
                        Alert(response);
                        ResetLastError();
                        Alert("You must close your Metatrader 5");
                     }



In my file api.asp, I received get data and return data ;0;0;1;1;0;1;1

If I put url in my browser, its works every time.


My question is:

Why I received url rejected and I must close my MT5 and reopen for works? 

And Why this happens only sometimes?


Thanks



12
To add comments, please log in or register