Open gnumarcelo opened 8 years ago
try to use JsonArrayRequest
2016-01-20 21:54 GMT+08:00 Marcelo Vitor F. Menezes < notifications@github.com>:
Hi, I'm trying to post a JSON object to my backend (rails) but the array param of my object is sending as String and not as a JSON array:
{ "is_delivered": true, "group_id": "569e6d287d0d6d343000000e", "orders_list": "[{\"name\":\"Mark\",\"active\":true}, {\"name\":\"Joana\",\"active\":true}]" }
Notice that my array are sending in quotes "[...]" and not as a JSON array [...], so my backend doesn't understand it as an array but as a String and it doesn't work as expected.
On the backend API side, I don't wanna ask them to change their api to support it as String and not Json, once it will drive us to a poorly api design.
Is there a way to send it as a real JSON Array? Is it a problem only with Volley lib?
ps.: I'm new in the android dev ps2.: I've googled it but didn't found any answer that addresses this issue.
— Reply to this email directly or view it on GitHub https://github.com/mcxiaoke/android-volley/issues/135.
Hi, I'm trying to post a JSON object to my backend (rails) but the array param of my object is sending as String and not as a JSON array:
{ "is_delivered": true, "group_id": "569e6d287d0d6d343000000e", "orders_list": "[{\"name\":\"Mark\",\"active\":true}, {\"name\":\"Joana\",\"active\":true}]" }
Notice that my array are sending in quotes "[...]" and not as a JSON array [...], so my backend doesn't understand it as an array but as a String and it doesn't work as expected.
On the backend API side, I don't wanna ask them to change their api to support it as String and not Json, once it will drive us to a poorly api design.
Is there a way to send it as a real JSON Array? Is it a problem only with Volley lib?
ps.: I'm new in the android dev ps2.: I've googled it but didn't find any answer that addresses this issue.