ajax - cannot read para from req.body - unified. Express. JQuery Post -



ajax - cannot read para from req.body - unified. Express. JQuery Post -

i trying pass info in jquery ajax post express.

client side:

var returnedvalue = []; returnedvalue.push({'key1':value1}); pass {'returnedvalue':returnedvalue} $.post()

serve side app.js

req.body {returnedvalue :[]} .

however, when seek changing client side code

json.stringify( {'returnedvalue':[{'key1':value}]}) $.post()

i can value @ app.js. think body parser set correctly.

any idea?

thanks hammer

more details update

for {'returnedvalue':returnedvalue}, print req.body on server shows empty obj, i.e. {}

jquery ajax express

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -