handy_httpd.components.handler

Contains core components for the HTTP handler structure.

Members

Classes

BasicServerExceptionHandler
class BasicServerExceptionHandler

A basic implementation of the ServerExceptionHandler which gracefully handles HttpStatusException by setting the response status, and defaults to a 500 INTERNAL SERVER ERROR respones for all other exceptions. If the response has already been flushed, an error will be logged.

HttpStatusException
class HttpStatusException

An exception that can be thrown to indicate that the current request should immediately respond with a specified status, short-circuiting any other handler logic. Note that it is still the responsibility of the server's exception handler to honor this exception, but by default, the BasicServerExceptionHandler does honor it.

Functions

isHttpRequestHandlerFunction
bool isHttpRequestHandlerFunction()

Compile-time function used to determine if something is a request handler function. That is, it returns void, takes ref HttpRequestContext as a single argument, and is callable.

noOpHandler
HttpRequestHandler noOpHandler()

Helper method for an HttpRequestHandler that simply responds with a 503 to any request.

toHandler
HttpRequestHandler toHandler(F fn)

Helper method to produce an HttpRequestHandler from a function.

Interfaces

HttpRequestHandler
interface HttpRequestHandler

Interface for any component that handles HTTP requests.

ServerExceptionHandler
interface ServerExceptionHandler

A specialized handler which is used for situations in which you'd like to gracefully handle an exception that occurs during processing a request.

Structs

HttpRequestContext
struct 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.