0
点赞
收藏
分享

微信扫一扫

Node.js -- Request Object

前行的跋涉者 2022-02-02 阅读 122

req.params

  • Node:
router.get('/yomama/:something', function(req, res, next) {
  console.log(req.params.something);
});
  • URI:
  • Output:

req.query

  • Node
router.get('/yomama/:something', function(req, res, next) {
  console.log(req.query)
});
  • URI:
  • Output:

req.path

  • URI: http://localhost:3000/fibonacci/yomama/3wafwa?node=xxx
  • Output: /yomama/3wafwa

req.url

  • URI: http://localhost:3000/fibonacci/yomama/3wafwa?node=xxx
  • Output: /yomama/3wafwa?node=xxx

req.body

举报

相关推荐

0 条评论