handy_httpd.util.builders

This module contains builder classes for a variety of components. These builders are not intended for performance uses; mostly testing.

Members

Classes

HttpRequestBuilder
class HttpRequestBuilder

A utility class for a fluent interface for building requests. This is useful for testing.

HttpRequestContextBuilder
class HttpRequestContextBuilder

A fluent-style builder for helping to create request contexts for unit testing of any HttpRequestHandler, HttpRequestFilter, ServerExceptionHandler, or any other components related to Handy-Httpd.

HttpResponseBuilder
class HttpResponseBuilder

A utility class that provides a fluent interface for building HttpResponse structs, mostly useful for testing.

ResponseCachingOutputStream
class ResponseCachingOutputStream

A byte output stream implementation that caches HTTP header and body content as it's written, so that you can fetch and inspect the contents later. This is mainly intended as a helper for unit tests that involve checking the raw response body for request handlers.

Functions

buildCtxForRequest
HttpRequestContext buildCtxForRequest(Method method, string url, string bodyContent, string contentType)

Builds a request context with a request with the given information, and a plain response that's ready to be written to.

buildCtxForRequest
HttpRequestContext buildCtxForRequest(Method method, string url)

Builds a request context with a request with the given information, and a plain response that's ready to be written to.