I want to send data to my API URL. How to post below JSON array?
The data I want to send is this:
requests: [
{
OptionID: [
{
ID: 'A1'
}
],
content: {
img: 'image'
}
}
]
Here is my code:
var data = "requests: [{ OptionID: [ {ID: 'A1'}], content: { img: 'image'}}]";
http.Response response = await http.post("https://MY_API_URL", body: data);
print(response.body);
Now I have an error about Invalid Argument because I don't know how to send a JSON array.
Can anyone help me?