Why does req.params return an empty array?

后端 未结 3 1073
野的像风
野的像风 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:42

    req.params only contain the route params, not query string params (from GET) and not body params (from POST). The param() function however checks all three, see:

    http://expressjs.com/4x/api.html#req.params

提交回复
热议问题