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
Post a Comment