express.js - req.body?

Use*_*r_y 8 node.js express

我是js的新手,我在阅读的代码中看到了很多

_.pick(req.body, ' ' , ' ') 
Run Code Online (Sandbox Code Playgroud)

req.body做什么?什么时候可以说req.body.something?

Tom*_*omJ 28

req.body保存作为POST请求的一部分从客户端发送的参数.请参阅API.

// POST user[name]=tobi&user[email]=tobi@learnboost.com
req.body.user.name
// => "tobi"

req.body.user.email
// => "tobi@learnboost.com"

// POST { "name": "tobi" }
req.body.name
// => "tobi"
Run Code Online (Sandbox Code Playgroud)