Skip to main content

Module head

Module head 

Available on crate features http and std only.
Expand description

Standalone HTTP/1 message-head parsing and encoding.

This module handles only a request or response line plus header fields. It deliberately does not infer or encode an HTTP body framing mode, which makes it suitable for protocols such as ICAP that carry HTTP heads while framing the associated entity body themselves.

Structs§

HeadError
Error returned by standalone HTTP/1 message-head operations.
HeadParser
Standalone HTTP/1 message-head parser configuration.

Enums§

HeadErrorKind
Classification for standalone HTTP/1 message-head failures.

Constants§

DEFAULT_MAX_HEADERS
Default maximum number of HTTP header fields in one standalone head.

Functions§

encode_header_block
Encode HTTP header fields and the empty line ending them, as a trailer section carries them, into an exactly sized buffer.
encode_header_fields
Append HTTP header fields in their insertion order and original casing.
encode_request
Encode one standalone HTTP/1 request head.
encode_request_target
Encode the HTTP/1 request-target selected by Rama connection metadata.
encode_response
Encode one standalone HTTP/1 response head.
is_http1_connect_target
Whether an HTTP/1 CONNECT can name uri: as host:port (RFC 9112 §3.2.3), and never as an Extended CONNECT, whose HTTP/1.1 form is an Upgrade request instead (RFC 8441 §5).