Request
Request
The 'Request' object is used to access the request data sent by the client to the server. It is available in the first argument of the route or middleware handler function.
Properties
Name | Type | Description |
---|---|---|
path | string | The path of the request. |
method | string | The HTTP method of the request. |
headers | object | An object containing the headers of the request. |
query | object | An object containing the query parameters of the request. |
params | object | An object containing the parameters of the request. |
body | string | The body of the request. This is only available for POST and PUT requests. |
type Request = {
path: string,
method: string,
headers: { [string]: string },
query: { [string]: string },
body: string
}