//导入body-parser模块
const bodyParser = require("body-parser");
//将模块注册上app实例上
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
#express#使用body-parser解析POST请求体
最新推荐文章于 2021-05-12 16:56:20 发布
//导入body-parser模块
const bodyParser = require("body-parser");
//将模块注册上app实例上
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());