req.query:get请求;
req.body:post请求;
(1) get请求:
req.query;
(2) post请求:
第一步:下载body-parser模块
npm install body-parser --save-dev
第二步:引入body-parser模块
const bodyParser = requier("body-parser");
第三步:使用body-parser模块
app.use(bodyParser.urlencoded({ extended: false }));
第四步:使用body-parser模块的参数json方法
app.use(bodyParser.json());
第五步:获取参数
req.body;