I have a client side JS file that has:
agent = require(\'superagent\'); request = agent.get(url);
Then I have something like
req.params
is route parameters, req.body
is the actual body of the request, and req.query
is any query parameters.
For example, if I declare this route:
router.get('/user/:id', function(req, res) {});
req.params
will contain id
.
If I pass a body to this route:
{
name: 'josh'
}
This will be in req.body
.
If I pass some query parameters to http://myserver.com/api/user?name="josh"
, req.query
will be { name: 'josh' }
.
Check out the Express docs.