Why does req.params return an empty array?

后端 未结 3 1072
野的像风
野的像风 2021-02-01 06:10

I\'m using Node.js and I want to see all of the parameters that have been posted to my script. To get to my function, in my routes/index.js I\'m doing:



        
3条回答
  •  长发绾君心
    2021-02-01 06:57

    req.params
    can only get the param of request url in this pattern:/user/:name

    req.query
    get query params(name) like /user?name=123 or body params.

提交回复
热议问题