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

NameTypeDescription
pathstringThe path of the request.
methodstringThe HTTP method of the request.
headersobjectAn object containing the headers of the request.
queryobjectAn object containing the query parameters of the request.
paramsobjectAn object containing the parameters of the request.
bodystringThe 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
}