I would like to know how to extract the post data from req.body.
My post data is
{
name:'asdf',
completed: false,
note: 'asdf'
}
When I am trying to console it using JSON.stringify , I am getting req.body as
{"{\n name:'asdf',completed:false,note:'asdf'}":""}
I noticed that new line and colon are getting added to the req.body object. So when I am trying to filter req.body.name its returning me undefined.
I have used app.use(bodyParser.json());
but still I am not getting the actual result
Hence I would like to know the following: 1. How to filter the post object? 2. Why new lines and colon are getting added to req.body object?