I have the following problem. I must send the following json
tosend = {"tn": 37537.6015625,
"d":
{"fa": 12, "nt": 37537.6015625, "ca": 1, "a": 4692.2001953125, "p": 4692.2001953125, "a": 1116861},
"tb": -27182.3984375}.
For this I used the method json.put () and then json.acummulate (“d”, JsonObject).
as I can do to give me the following result
tosend = {"tn": 37537.6015625,
"d":
[{"Fa": 12, "nt": 37537.6015625, "ca": 1, "a": 4692.2001953125, "p": 4692.2001953125, "a": 1116861}
], "Tb": -27182.3984375}.
when I add two data fuciona “[“. I need to send it this way because I can not change the script on the server.
I used to use the json.append.
Create Current jsonObject as :
and no need to call JSONObject. accumulate because this method Appends value to the array already mapped to name . because your main json string which u want to send to server has only jsonObject