初学node,关于使用req.body,打印的值为空解决方法

初学node,关于使用req.body,打印的值为空解决方法

想在这里打印出userinfo的值

image-20210120185527990

需要先在项目中:

npm install body-parser

然后在入口文件app.js中即可:

var bodyParser = require('body-parser')

app.use(bodyParser.urlencoded({ extended: false }));

参考链接:https://blog.csdn.net/chongxiao2168/article/details/100867088

posted @ 2021-01-20 19:02  啊方不方  阅读(397)  评论(0编辑  收藏  举报