I'm using Insomnia to test requests to my API. Can someone explain why the request in the first image works, but the second image only posts the first object in the array?
For reference, here's the array of objects I'm trying to post:
[{
"period":5,
"uploadDate":"2015-11-19T21:00:00.000Z",
"transferCode":"23100","vendor":"Unity State",
"voucherNumber": "0000047538",
"description":"1003-1495 Condi Operating Oct ",
"amount":7083
},
{
"period":5,
"uploadDate":"2015-11-19T21:00:00.000Z",
"transferCode":"23100",
"vendor":"Northern Bahr-el State",
"voucherNumber":"0000047546",
"description":"1003-1494 Condi Operating Oct ",
"amount":7083
}]
As well as the code I'm using in Nodejs:
//transferController.js in Node
function createTransfer(request, response) {
console.log('posting');
console.log('body: ' + request.body); //TEST
console.info("Body: " + JSON.stringify(request.body)); //TEST
var transfer = new Transfer(request.body);
transfer.save(function(error) {
// console.log('transfer and transfer: ' + transfer);
if(error) return response.json({ message: 'could not create transfer because ' + error });
response.json({ transfer: transfer });
});
}


"vendor": "Northern Bahr-el Ghazal"