HttpRequest

Constructors

this
this(bool add_entity_headers, size_t msg_body_prealloc_length, uint uri_prealloc_length)
this(size_t msg_body_prealloc_length)

Constructor

Members

Functions

finished
bool finished()
getUint
uint getUint(cstring header_field_name)

Obtains the integer value of the request header field corresponding to header_field_name. The header field value is expected to represent an unsigned integer number in decimal representation.

method_name
cstring method_name()
msg_body
cstring msg_body()

Obtains the request message body (which may be empty). It may be incomplete if parse() did not yet reach the end of the request message or null if parse() did not yet reach the end of the request message header.

parse
size_t parse(cstring content, size_t msg_body_length)

Parses content which is expected to be either the start of a HTTP message or a HTTP message fragment that continues the content passed on the last call to this method. If this method is called again after having finished, it will reset the status first and start parsing a new request message.

reset
void reset()

Resets the state

uri
Uri uri()

URI parser

uri_string
cstring uri_string()

Static functions

min
size_t min(size_t a, size_t b)

Returns the minimum of a and b.

Variables

header
IHttpHeaderParser header;

Message header parser instance to get header parse results and set limitations.

http_exception
HttpException http_exception;

Reusable exception instances

max_uri_length
uint max_uri_length;

Maximum accepted request URI length

method
HttpMethod method;

Requested HTTP method

Inherited Members

From HttpHeader

HeaderFieldNames
alias HeaderFieldNames = .HeaderFieldNames

Type alias for request header field constant definitions

http_version_
HttpVersion http_version_;

HTTP version

http_version
HttpVersion http_version(HttpVersion v)

Sets the response HTTP version to v. v must be a known HttpVersion enumerator value and not be HttpVersion.Undefined.

http_version
HttpVersion http_version()

Gets the response HTTP version.

addCustomHeaders
void addCustomHeaders(cstring[] header_field_names)

Adds the elements of header_field_names to the set of request message header fields of interest.

Meta