标签:console use div 配置 app fun post log require
1. 安装
npm install body-parser
2.
var bodyParser = require(‘body-parser‘); //只要加入这个配置,在req请求对象上会多出来一个属性 //parse application/x-www-form-urlencoded app.use(bodyParser.urlencoded({ extended: false })) //parse application/json app.use(bodyParser.json())
app.post(‘/test‘, function(req, res) {
console.log(req.body);
});
标签:console use div 配置 app fun post log require
原文地址:https://www.cnblogs.com/flyerya/p/11433073.html