I'm pretty new to javascript and i'm trying to send an object with an other object inside trought post method:
$.post('/posttest', {tableName : 'WSTest', data : {name : "Rachid", age : 42, ville : "Tokyo"}}).done(function(data) {
console.log("data posted : ", data);
});
I can retrieve tableName with req.body.tableName but req.body.data give me undefined. When i console.log(req.body) i got:
{ tableName: 'WSTest',
'data[name]': 'Rachid',
'data[age]': '42',
'data[ville]': 'Tokyo' }
As far as i understand it, javascript takes data as a dico ? How can i make data as an object ?