Problem solving of req.body undefined

With multi-dimensional model as the core, let the factory digital transformation and upgrading “within reach”>>>

In the development process, req. Body has been unable to obtain the problem records

introduce bodyparser into app.js

var bodyParser = require(‘body-parser’);

secondly, you need to use bodyparser in app.js

app.use(bodyParser());

finally, you need to provide parameters for the bodyparser

‘content type ‘:’application/x-www-form-urlencoded’

the parameters of bodyparser are set according to the file type to be parsed. There are many types of parameters. You can check the specific literature

how to find out the overdue situation in 3, it will be changed to app. Use (bodyparser. Urlencoded ({ extended:false }));

Similar Posts: