I should translate this little bit of code into b4X, and it seems very easy to do
I translated it like this
But I get this error, as if the JSON format is wrong, but it is not because I have previously done the parsing. It seems to be related to the passing or serialization of the parameter and I assume it concerns the line reported in C #.
How could I correct?
B4X:
req = new RestRequest(Method.POST);
req.AddHeader("content-type", "application/json");
req.AddParameter("application/octet-stream", json, ParameterType.RequestBody);
B4X:
client.Initialize("",Me)
client.PostString("https://xxx.xxx.xxx", "application/octet-stream=" & toJson)))
client.GetRequest.SetContentType("application/json")
But I get this error, as if the JSON format is wrong, but it is not because I have previously done the parsing. It seems to be related to the passing or serialization of the parameter and I assume it concerns the line reported in C #.
How could I correct?