I\'m designing REST API that should be able to accept array of objects, say
[
{
\'name\': \'Alice\',
\'age\': 15
},
{
\'name\': \'Bob\',
\'age
Basically, the answer I was looking for was:
Content-Type: application/x-www-form-urlencoded
which is standard in web; instead, Content-Type: application/json
should be used,The whole HTTP request then looks as follows:
POST /whatever HTTP/1.1
Host: api.example.com
Content-Type: application/json
[
{
'name': 'Alice',
'age': 15
},
{
'name': 'Bob',
'age': 20
},
...
]