The ContextRequest class wraps Dart's native HttpRequest object, providing a convenient interface for accessing request data such as headers, query parameters, cookies, and payloads, as well as determining the request's content type. It too abstracts away the complexity of handling different types of HTTP requests, making it easier for developers to access the data they need without delving into the lower-level details of parsing request headers, cookies, and payloads. It's a helpful utility for web server development in Dart, especially when building RESTful APIs or handling form submissions.
This class contains the response of the request.
It is used to set the headers, cookies, status code and
send the response with the type given (json, html, text, etc).
You can also add a callback that will be called when the response is disposed.
This class represents a parsed multipart/form-data payload, providing access to the payload's content type, content disposition, and content transfer encoding.
Middleware class has a handler function that executes before the route handler and can be used to perform operations like logging, authentication, etc.
This class is used to encapsulate the data of a file upload or form field in a request payload.
It contains the name, MIME type, content transfer encoding, and raw bytes of the file or field data.
NanoSocket is a class that represents a WebSocket connection.
It has methods to send messages, emit events, close the connection, and more.
It also has methods to handle rooms, broadcast messages, and emit events to all connected sockets.
It is used in the WebSocket handler to manage the WebSocket connections.