I know how to send a POST Request in MQL5 and how to pass the data
but I would like to send the body with a certain format
what I mean , I have these values
int x = 0;
int y = 1;
I would like to have the body in this format (you know the REST API accept JSON body)
{
"singalData" : {
"x" : 0,
"y" : 1
}
}
how to convert from these variables to this format ?
#include <jason.mqh> void OnStart() { int x = 1; int y = 2; CJAVal json; json["singalData"]["x"] = x; json["singalData"]["y"] = y; Print(json.Serialize()); } //{"singalData":{"x":1,"y":2}}
- www.mql5.com
your code helped , but there's something
the
data attribute in WebService accept only const char data
so
it says : 'WebRequest' - no one of the overloads can be applied to the function call"
your code helped , but there's something
the data attribute
in WebService accept only const char data
so it says : 'WebRequest' - no one of the overloads can be applied to the function call"
Show your code, there might be a syntax error.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I know how to send a POST Request in MQL5 and how to pass the data
but I would like to send the body with a certain format
what I mean , I have these values
int x = 0;
int y = 1;
I would like to have the body in this format (you know the REST API accept JSON body)
{
"singalData" : {
"x" : 0,
"y" : 1
}
}
how to convert from these variables to this format ?