I would think that the code would also not work on MT5. Your data_size is zero in the call, so no data should be sent.
I would think that the code would also not work on MT5. Your data_size is zero in the call, so no data should be sent.
Interestingly enough it works in MT5 as I copied it over from one of my applications that is up an running.
I am still puzzled as to why it doesn't work. Even in the documentation they use 0 as data_size when doing a post request
Ps. Changing the data size doesn't help in any way

- docs.mql4.com
Hi,
I am struggling to find out what might be wrong with my webrequest and the reason why there is no post data.
The above snippet of code works in mql5 and I get post data on the server side. However the same request in mql4 sends no post data to the server.
I have added the URL in the listed URLs and I can see that there is a request coming from mt4 however the payload is just an empty b''
Any ideas?
StringToCharArray("some_info", post,0,StringLen("some_info"));
will work on MQL4 , because I think there is glitch in mql4 as it uses by default value "WHOLE_ARRAY" I don't know why it doesn't work with WebRequest correctly , maybe because it results in one more char than actual length of string , anyways I use it like that and it works. when I use the defulalt values of StringToChar it doesn't .
Also use the second version of the WebRequest which doesn't use data size in it
Btw why you don't just add the data that you want to pass to the url as you are using "GET" method ?

- www.mql5.com
use StringLength
will work on MQL4 , because I think there is glitch in mql4 as it uses by default value "WHOLE_ARRAY" I don't know why it doesn't work with WebRequest correctly , maybe because it results in one more char than actual length of string , anyways I use it like that and it works. when I use the defulalt values of StringToChar it doesn't .
Also use the second version of the WebRequest which doesn't use data size in it
Btw why you don't just add the data that you want to pass to the url as you are using "GET" method ?
"Btw why you don't just add the data that you want to pass to the url as you are using "GET" method"
Yes, this is what I did and it worked. I guess this approach is better than passing arrays.
Thanks for the advice!
"Btw why you don't just add the data that you want to pass to the url as you are using "GET" method"
Yes, this is what I did and it worked. I guess this approach is better than passing arrays.
Thanks for the advice!

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
I am struggling to find out what might be wrong with my webrequest and the reason why there is no post data.
The above snippet of code works in mql5 and I get post data on the server side. However the same request in mql4 sends no post data to the server.
I have added the URL in the listed URLs and I can see that there is a request coming from mt4 however the payload is just an empty b''
Any ideas?