express 路由url参数获取

1.get方法

  • 经过 req.query解析出来

2.post方法

  • 1.req.body 解析出来
//bodyParser
app.use(express.urlencoded({ extended: true, limit: '50mb' }));

3. :id

app.post('/get_json/:id', function (req, res) {
  // 响应块代码
})
  • req.params获取
相关文章
相关标签/搜索