I would like to write a Controller to which a client can pass a JSON Array (e.g. using POST).
Example:
POST /index.php/apps/myapp/api
[{id:5,data:"xyz"},{id:8,data:"xyz"}]
Unfortunately, I found no way, how to access this array in the Controller, since there is no variable Name, I can use as Parameter in my Controller method.
Is this possible, or would I have to embed my Array in a JSON object?
e.g.: {items: [{id:5,data:"xyz"},{id:8,data:"xyz"}]}
Then, I could use the variable $items as parameter in my Controller. However, the JSON string would be more complicated. Is there a better way?