"name": "body-parser", "version": "1.13.3",
my json request body is{user:'guow'}
, but express request.body is { '{user:\'guow\'}': '' }
This is configuration of my express app
var bodyParser = require('body-parser'); //
var multer = require('multer');
app.use(bodyParser.json()); // for parsing application/json
app.use(bodyParser.urlencoded({ extended: false })); // for parsing application/x-www-form-urlencoded //
app.use(multer());
I am sending request with jquery and my code is
$.ajax({ type: “POST”, url: “/login”, cache: false, dataType: 'json', data:“{user:'guow'}"});
Will someone encountered such a problem?