Expand description
Field names and values (RFC 9110 §5).
The grammar every version shares: a name is a token, a value is visible
octets, spaces and tabs with none at either end. HTTP/2 and HTTP/3 add
that names are lowercase and that connection-specific fields are malformed
(CONNECTION_SPECIFIC); those rules live in their modules.
Structs§
- Field
- One field line as it arrived: the name as written (case preserved) and the value with surrounding whitespace removed.
Constants§
- CONNECTION_
SPECIFIC - The fields RFC 9113 §8.2.2 and RFC 9114 §4.2 call connection-specific: an HTTP/2 or HTTP/3 message that carries one is malformed, and an HTTP/1.1 library manages them itself rather than taking them from an application.
Functions§
- is_
connection_ specific - Whether
nameis one ofCONNECTION_SPECIFIC, ignoring ASCII case. - is_
field_ value - A field value (RFC 9110 §5.5):
VCHAR,obs-text, SP and HTAB, no CR, LF or NUL, and no SP or HTAB at either end. The empty value is valid. - is_
sensitive - Whether a field carries a credential an encoder must never put into a
compression table, and a log must never print:
authorization,proxy-authorization,cookieandset-cookie, compared ignoring ASCII case (RFC 7541 §7.1.3, RFC 9204 §7.1.3). - is_
tchar tchar(RFC 9110 §5.6.2).- is_
token - A non-empty run of
tchar: a field name or a method (RFC 9110 §5.6.2). - trim_
ows - Strips SP and HTAB from both ends (RFC 9110 §5.5 OWS).