express4.16.1 中通过req.body获取值为undefined的问题
确保项目已经安装了body-parser
npm i body-parser
app.js配置如下
const bodyParser = require("body-parser");
var app = express();
// 解析 application/x-www-form-urlencoded
var urlencodedParser = bodyParser.urlencoded({ extended: false });
// 解析 application/json
var jsonPa
原创
2021-03-16 16:42:15 ·
219 阅读 ·
0 评论