handy_httpd.components.multipart

Defines data structures and parsing methods for dealing with multipart encoded request bodies.

Members

Classes

MultipartFormatException
class MultipartFormatException

An exception that's thrown if parsing multipart/form-data fails due to invalid formatting or unexpected characters. This is a sub-class of the HttpStatusException, with each multipart exception being a BAD_REQUEST.

Functions

parseMultipartFormData
MultipartFormData parseMultipartFormData(string content, string boundary)

A simple linear parser for multipart/form-data encoded content. Reads a series of elements separated by a given boundary. An exception is thrown if the given content doesn't conform to standard multipart format.

readBodyAsMultipartFormData
MultipartFormData readBodyAsMultipartFormData(HttpRequest request, bool allowInfiniteRead)

Reads a request's body as multipart/form-data encoded elements.

Structs

MultipartElement
struct MultipartElement

A single element that's part of a multipart/form-data body.

MultipartFormData
struct MultipartFormData

A multipart/form-data body containing multiple elements, and some helper methods for those elements.

Variables

MAX_ELEMENTS
auto MAX_ELEMENTS;

The maximum number of parts to read in a multipart/form-data body. This is declared as a safety measure to avoid infinite reading of malicious or corrupted payloads.