I have a post object. Like Below.
{
"facilities": value.join(","),
"start_date": startDate.toString().substring(0, 10),
"end_date": endDate.toString().substring(0, 10),
"over_ratio": false,
"total": true
}
I send this object in body, but server send me 404 message. but When I write my bool data like "over_ratio": "false", "total": "true", server understands this bool data wrong.
var response = await http.post(url, body: body);
if (response.statusCode == 200) {
print(response.body);
}
I need to send this bodys bool data like:
{
"facilities": value.join(","),
"start_date": startDate.toString().substring(0, 10),
"end_date": endDate.toString().substring(0, 10),
"over_ratio": false,
"total": true
}
I also tried like, but same problem occurs:
json.encode({
"facilities": value.join(","),
"start_date": startDate.toString().substring(0, 10),
"end_date": endDate.toString().substring(0, 10),
"over_ratio": false,
"total": true
});
How can I send this post correctly ? Thanks.