WebRequest - using 2nd type of the function

 

Hello fellow traders/developers.

I've found WebRequest function in the reference doc [1]. According to the doc there are 2 types of the function but I'm not able to convinced mql compiler to use the 2nd one.

My intention is to send HTTP POST request to my json web service. Hence I'd obviously need to change corresponding content type in the request header to 'Content-Type: application/json'. Whilst this is not possible to do with 1st type of WebRequest,it should be possible with 2nd type. Hovewer I'm not able to compile my code. Event the sample provided in the doc is wrong and could not be compiled.

Compilation of: res=WebRequest("POST","https://www.mql5.com/en/auth_login",NULL,0,data,data,str); giving me this error [2] :


Does anyody have any idea how one could use advertised 2nd type of the WebRequest function call?

Regards Tomas

[1] https://docs.mql4.com/common/webrequest

[2]'WebRequest' - wrong parameters count    test.mqh    124    8

WebRequest - MQL4 Documentation
  • docs.mql4.com
WebRequest - MQL4 Documentation
 
mcquak:

Hello fellow traders/developers.

I've found WebRequest function in the reference doc [1]. According to the doc there are 2 types of the function but I'm not able to convinced mql compiler to use the 2nd one.

My intention is to send HTTP POST request to my json web service. Hence I'd obviously need to change corresponding content type in the request header to 'Content-Type: application/json'. Whilst this is not possible to do with 1st type of WebRequest,it should be possible with 2nd type. Hovewer I'm not able to compile my code. Event the sample provided in the doc is wrong and could not be compiled.

Compilation of: res=WebRequest("POST","https://www.mql5.com/en/auth_login",NULL,0,data,data,str); giving me this error [2] :


Does anyody have any idea how one could use advertised 2nd type WebRequest function call?

Regards Tomas

[1] https://docs.mql4.com/common/webrequest

[2]'WebRequest' - wrong parameters count    test.mqh    124    8

What is your MT4 build ?
 
angevoyageur:
What is your MT4 build ?
I've got MT4 version 4.0 build 765
 
mcquak:
I've got MT4 version 4.0 build 765
Bug in build 765. It works on build 769.
 
angevoyageur:
Bug in build 765. It works on build 769.

It helped. Currently I have got build 777 and WebRequest with POST method and json content works perfectly.

Merci angevoyageur

 
Hi, how come the latest version is only build 765 on my MT4
 
mcquak:

It helped. Currently I have got build 777 and WebRequest with POST method and json content works perfectly.

Merci angevoyageur

Where to get the Build 777.  The since the latest version is build 765, 12 December 2014

 

 
scndlee:

Where to get the Build 777.  The since the latest version is build 765, 12 December 2014

 

 

See instructions for downloading current build here:

Forum on trading, automated trading systems and testing trading strategies

Rent Market Products and Save Your Money!

Filter, 2015.03.05 23:35

In MT4, go to open a new account in the file menu. When it brings up a list of servers, click to add a new server and just type in metaquotes. It will then scan for and find the metaquotes demo server. Open a new demo account and log in.

Keep an eye on the journal tab and you should see something like "new version available". It will then begin to download in the background. It may take a while to download. Just keep watching the "connection" area at the bottom right, you'll see it downloading as the Kb counter ticks away. I can't remember if it tells you that it's finished downloading or not.

Once it has finished, shut down MT4 and restart. It should then begin updating itself (will take around 10 seconds to start). You can confirm you have the new version by checking the journal (you'll see the update process) and finally, by clicking help-> about.