I am just trying to do a hello world programme with WebRequest and finding it a bit difficult. Send a post request to a php page and return the response. I have searched the forums for examples and there is little. The one MT uses does not even compile. Not sure why they can't just give a simple example. Anyway. Any help would be appreciated, as well for others. I get the feeling I am not the only one, judging by comments on forum posts.
Here is what I have, the results of this is that it does go to the URL and executes the PHP, the issue is that the $_post yields nothing. I do see in the header the content length change when I adjust the input - just no data. There must be a secret to this data input field of WebRequest. I tried to play with refer, etc....it does nothing. Simple defaults seem to work the same.
EA script.
int init()
{
string headers;
char data[], result[];
string str = "data=value"; // post data variables to send
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
I am just trying to do a hello world programme with WebRequest and finding it a bit difficult. Send a post request to a php page and return the response. I have searched the forums for examples and there is little. The one MT uses does not even compile. Not sure why they can't just give a simple example. Anyway. Any help would be appreciated, as well for others. I get the feeling I am not the only one, judging by comments on forum posts.
Here is what I have, the results of this is that it does go to the URL and executes the PHP, the issue is that the $_post yields nothing. I do see in the header the content length change when I adjust the input - just no data. There must be a secret to this data input field of WebRequest. I tried to play with refer, etc....it does nothing. Simple defaults seem to work the same.
EA script.
int init()
{
}
The PHP: xyz.php
<?php
?>