Passing ARRAY types as Request Parameters in a REST Service?
In regards to REST services, how do you give a request parameter of type of ARRAY?
I am trying to add a relation between Parse.com's Users class and my own class. You have to be able to pass it an array of object parameters.
==== PARSE.COM DOCUMENTATION =================================
In order to update Relation types, Parse provides special operators to atomically add and remove objects to a relation. So, we can add an object to a relation like so:
curl -X PUT \
-H "X-Parse-Application-Id: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "X-Parse-REST-API-Key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"opponents":{"op":"AddRelation","objects":[{"type":"Pointer","className":"Player","objectId":"Vx4nudeWn"}]}}' \
https://api.parse.com/1/classes/GameS...
================================================================
ref: https://www.parse.com/docs/rest#objec... - look at the "Relations" section
It is expecting the "objects" parameter to be an array and not a string.
I get back the following error:
Server response:
{
"error": "relation operations take array arguments, got a String instead",
"code": 111
}