I have a function in my controller decorated with the @request.restful() decorator. I would like to be able to accept a JSON array of objects,
[{"id": 1, "new_value": 1},{"id": 2, "new_value": 2}]
, on a POST, PUT, or DELETE. For example, I'd like the client to be able to update a series of values on one request, as opposed to having to submit multiple requests for each individual update. However, the args and vars parameters being passed to the methods are empty when a request is sent with the JSON payload above. Specifically, args only gets populated from URL args and vars only get populated if the array is accompanied by a key, such as in:
{"update": [{"id": 1, "new_value": 1},{"id": 2, "new_value": 2}]}
While it certainly isn't too much trouble to include that initial key, I was wondering if there's any way to retrieve the JSON objects from the request without having to specify the key so that I could pass a simple array instead?
Thank you ahead of time for any help.