Module http::headers
HttpHeaders: a structured, ordered, case-insensitive HTTP header map.
HttpRequest/HttpResponse keep their headers as one raw "Key: value" block (std/http/http.h) — cheap to build, and what the wire carries. HttpHeaders is the structured view for code that wants to iterate, edit or look headers up repeatedly: parse() a raw block into one, to_raw() it back. Names keep the case they were given; every lookup ignores ASCII case (RFC 9110 §5.1). Order is preserved, and a name may appear more than once (Set-Cookie, Vary, ...).
For a single lookup or edit on a raw block, std/http/http.h's http_header_get / http_headers_set / http_headers_add / http_headers_remove avoid building one of these at all.
Structs
| HttpHeaderField | |
| HttpHeaders |
Functions
| http_header_param | A parameter of a structured header value — the "boundary" of 'multipart/form-data; boundary="xyz"', the "filename" of a Content-Disposition. Quoted values are unquoted (backslash escapes resolved); names compare case-insensitively. Empty String if absent. |
| http_header_main_value | The part of such a value before the first ';', trimmed and lowercased ("multipart/form-data"). |
| http_name_eq | Case-insensitive ASCII comparison of two NUL-terminated strings (1 if equal) — the comparison header names use. |