expressjs / body-parser

Node.js body parsing middleware
MIT License
5.43k stars 722 forks source link

how to do JSON.parse? in body-parser ? #533

Closed Bimbimz closed 1 week ago

Bimbimz commented 2 weeks ago

on the client side I use jquery:

let data = {
    email: 'myemail@domain.com',
    password: 'test1234'
}
$.post('http://localhost:3000/auth', {
    data: JSON.stringify(data)
}, function (res) {
    console.log(res)
})
wesleytodd commented 1 week ago

Sorry your question is not clear. Body parser will decode this json data, so unless you can provide some more information about the issue you are having we cannot really help you. Please re-open this if you have more info to provide.