I\'m designing REST API that should be able to accept array of objects, say
[ { \'name\': \'Alice\', \'age\': 15 }, { \'name\': \'Bob\', \'age
There is no need to wrap the array in another object with a data property. The array by itself is valid JSON:
data
post_params = JSON.stringify([ { 'name' : 'Alice', 'age' : 15 }, { 'name' : 'Bob', 'age' : 20 }, ... ]); post(url, post_params);
Just make sure your API expects this array as well.