Node.js -- Request Object

阅读 123

2022-02-02

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)

0 0 举报