Request Class
The request class is a wrapper around the native request object that provides additional functionality and convenience methods. It can map to either Node.js HTTP Incoming Message and WHATWG Request objects. The primary purpose is to provide a consistent API for handling requests, regardless of the underlying implementation. The request class is designed to work with several mediums including HTTP requests, WebSocket requests, CLI requests, etc.
body
The raw request body. The body can be a type of , , , , , or .
❐ Copy
data
A callable nest that manages the request data. This combines the inputs from URL search queries, POST data and URL parameters respectively.
❐ Copy
headers
A callable map that manages the request headers.
❐ Copy
loaded
Returns true if the body is loaded
❐ Copy
loader
Sets the loader. This function is called when the is called.
❐ Copy
method
The request HTTP method.
❐ Copy
mimetype
Returns the request mimetype.
❐ Copy
post
A callable nest that manages the request POST data.
❐ Copy
query
A callable nest that manages the request query.
❐ Copy
resource
Returns the raw IncomingMessage or Request object. It's also possible that there is no resource at all.
❐ Copy
session
A callable session that manages the request session data.
❐ Copy
type
Returns the type of body.
❐ Copy
url
The request URL.
❐ Copy
load()
Loads the body if was set.
❐ Copy