I am passing a POST that includes an array of "wines". The object on the send looks line. However when I log the request on the server side, the array is a collection of keys and values. What am I missing:
**** MY TEST REQUESTING CODE ****
request.post("http://localhost:3000/todos", {form: params}, function(err, response){
console.log(response.body);
})
**** THE OPTION AS IT IS BEING SENT ****
var params = {
name: 'Test Do',
summary: 'This is the summary',
wines: ['56ad66897070ffc5387352dc', '56dg66898180ffd6487353ef']
}
**** MY SERVER SIDE CODE --- SHORTEN FOR BREVITY ***
exports.todoPost = function(req, res){
console.log(req.body);
var todo = new ToDo(req.body);
todo.save(function(err, todoX){
if(err){return res.send.err;}
console.log(req.body.store_config)
if(todo.wines){
**** THE OUTPUT OF 'console.log(req.body) ****
{ name: 'Test Do',
summary: 'This is the summary',
'wines[0]': '56ad66897070ffc5387352dc',
'wines[1]': '56dg66898180ffd6487353ef' }
Can I not send an array in a POST? Everything I see online and everything I've tried isn't working. It says I'm passing stuff correctly.