Headers #
This module defines the Headers type, which represents a collection of HTTP header name-value pairs.
Reference: https://www.rfc-editor.org/rfc/rfc9110.html#section-5
A structure for managing HTTP headers as key-value pairs.
Reference: https://www.rfc-editor.org/rfc/rfc9110.html#section-5
The underlying multimap that stores headers.
Instances For
Retrieves the first Header.Value for the given key.
Instances For
Retrieves all Header.Value entries for the given key.
Instances For
Like getAll, but returns none instead of requiring a membership proof.
Returns none if the header is absent.
Instances For
Retrieves the first Header.Value for the given key.
Returns none if the header is absent.
Instances For
Retrieves the last header value for the given key.
Returns none if the header is absent.
Instances For
Inserts a new key-value pair into the headers.
Instances For
Adds a header from string name and value, panicking if either is invalid.
Instances For
Inserts a new key with an array of values.
Instances For
Creates headers from a list of key-value pairs.
Instances For
Checks if a header with the given name exists.
Instances For
Removes a header with the given name.
Instances For
Gets the number of headers.
Instances For
Checks if the headers are empty.
Instances For
Merges two headers, accumulating values for duplicate keys from both.
Instances For
Converts the headers to a list of key-value pairs (flattened). Each header with multiple values produces multiple pairs.
Instances For
Converts the headers to an array of key-value pairs (flattened). Each header with multiple values produces multiple pairs.
Instances For
Folds over all key-value pairs in the headers.
Instances For
Maps a function over all header values, producing new headers.
Instances For
Filters and maps over header key-value pairs. Returns only the pairs for which the function returns some.
Instances For
Filters header key-value pairs, keeping only those that satisfy the predicate.
Instances For
Updates all the values of a header if it exists.
Instances For
Replaces the last value for the given header name. If the header is absent, returns the headers unchanged.