HttpRequestContext

A simple container for the components that are available in the context of handling an HttpRequest. This includes the request, response, server, and other associated objects.

Members

Aliases

req
alias req = request

An alias for the context's HTTP request.

resp
alias resp = response

An alias for the context's HTTP response.

Variables

clientSocket
Socket clientSocket;

The underlying socket to this request's client. In the vast majority of use cases, you do not need to use this directly, as there are more convenient and safer facilities available.

metadata
Object[string] metadata;

An associative array of objects, indexed by string names, that pertain to this request context. Filters, handlers, and other middlewares may add data to this mapping for later usage. Think of it as "request-local" storage, similar to thread-local storage. All objects in this mapping are discarded once this request context has completed its processing.

request
HttpRequest request;

The request that a client sent.

response
HttpResponse response;

The response that

server
HttpServer server;

The server from which this context was created.