A question about the http request
-
When we use the http request function, does this function pass the values through url?
Let's say we wanna send the account number "123456" to "xyz.com"
Will the account number be sent by adding the account number inside of the url itself? Or is it some other wayI am totally ignorant about the http request, and for some reason I can't understand it at all.
So pardon me if it's a totally crappy question -
This is a question for roar and miro, obviously!

-
@l-andorrà alright then, it seems I'll need to request the legend level players to have a look at this topic then

-
@zackry never used that block lol

Based on my tiny knowledge of http stuff, you have to use POST method for sending the account number, but yeah I'd guess its possible with that block.
https://www.w3schools.com/tags/ref_httpmethods.asp -
yes it should work
or use the Custom MQL code block, compose a line of the WebRequest() function using this note:
https://docs.mql4.com/common/webrequest -
-
yes, if it is your server, you can do all the stuff, just check some simple tutorials on youtube:
https://www.youtube.com/watch?v=dgvLegLW6ek
if it is a different server, you need to adapt to it -
@miro1360 thanks Miro thanks a lot , will check it out
-
@miro1360 hi miro, it took me a while to understand the http request to the python server, but I finally got a bit of understanding, I tested it and it's working, I created a simple http server on a vps and exposed it to internet via ngrok
And then sent the request via an ea made in fxdreema, the request was received splendidly....A question about this whole cycle, let say the ea send the request to the server, does it wait for the response by default?
-
Waiting for the response is executed by a WebRequest() function which is part of the block "Send HTTP request" and sadly it is synchronous - it breaks the EA and waits for the response from the requested server in a specific delay (can be set). If the delay elapses without the response, EA continues in a normal cycle. If this whole thing works I can't confirm because I've never tried it
If you want something more dynamic, you can try at least 2 possibilities:- program your own waiting server outside MT4 (use something as simple as the python again)
- lazier (and still functional) workaround: create another EA - purely only as a waiting EA for the request
and bridge it with your main EA using global variables
(global variables in MQL == Terminal variable in fxdreema) ... if you need more "asynchronous" requests, simply open more waiting EAs and more variables

-
@miro1360 i never thought about creating another as a waiting EA, the thought never crossed my mind , and kept on hitting my head to find a way, thanks for the idea miro , definitely gonna try the waiting ea method cuz its much more simpler .....
-
@miro1360 by the way is there any way of storing the response into a variable ?
-
do you mean this response? if so, you can try it and tell us if that worked

