-
Notifications
You must be signed in to change notification settings - Fork 39
Request
Elliott Minns edited this page Feb 22, 2016
·
5 revisions
The request
object represents the HTTP request and has properties for the request query string, parameters, body, HTTP headers, and so on. In this documentation and by convention, the object is always referred to as request
(and the HTTP response is response
) but its actual name is determined by the parameters to the callback function in which you’re working.
For example:
app.get("/user/:id") { request, response in
response.send(text: 'user ' + request.data["id"])
}
But you could just as well have:
app.get("/user/:id") { req, res in
res.send(text: 'user ' + req.data["id"])
}