EventHandler type is a function type that defines the signature for handling events triggered
by HTTP requests. It takes references to an HTTPRequest and a mutable HTTPResponse as parameters.
The HTTPRequest struct represents an HTTP request received by
the web server. It encapsulates various components of an HTTP request,
including the HTTP method, request path, headers, and body.
The HTTPResponse struct represents an HTTP response that the web server can send to clients.
It encapsulates various components of an HTTP response, including the response body, headers,
status code, status text, and the HTTP version.
RequestHandler type is a function type that defines the signature for handling HTTP requests.
It takes HTTPRequest and HashMap<String, PathExpr> as a parameter and returns an HTTPResponse
The SoftEventHandler type is a function type that defines the signature for handling soft events,
typically without specific request or response parameters.
CRLF represents the Carriage Return (CR) and Line Feed (LF)
characters combined (“\r\n”). It is commonly used as the
end-of-line sequence in HTTP requests and responses.
MAX_BUFFER defines the maximum size, in bytes, for a request
in your web server. Requests exceeding this size may be rejected or
handled differently based on your server’s implementation.
The Headers type alias represents a collection of HTTP headers in key-value pairs. It is implemented
as a HashMap<String, String>, where keys are header names, and values are header values.
The URLSearchParams type alias represents a collection of URL parameters parsed from an HTTP request’s
query string. It is implemented as a HashMap<String, String> where keys are parameter names, and values
are parameter values.