Sudden failure of express body-parser middleware?

problem description

recently, middleware (body-parser) in express suddenly fails, req.body can not get any value , req.query can get the value . It was useful to add body-parser middleware at first, until yesterday when token was added, body-parser failed. Try to get rid of token, it is useless, it is not this problem, it is also said that the version is not right, the introduction of middleware, or useless!

related codes

 const bodyParser = require("body-parser");
 app.use(bodyParser.json());

solve the problem by yourself. Set Content-Type in the request header to application/json .

headers: {
    'Content-Type': 'application/json'
}

in addition, req.body cannot accept any parameters for a direct request in postman .
solution: request: check raw in the request body, and set the format to JSON (application/json) .

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e6f112-22b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e6f112-22b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?