Expand description
Escaping for free-form values carried in HTTP headers.
HTTP header values carry only visible ASCII, so any value that may contain arbitrary Unicode —
an object key, a filename, a custom metadata value — has to be escaped to survive the
transport. This module owns that escaping for the whole workspace: it is the only place that
depends on [percent_encoding], so callers escape by name rather than by assembling a
character set of their own.
Encoding is a property of the transport, never of the value: everything in memory holds the
logical string, and encode_header_value is applied only when writing a header.
Structs§
- ExtValue
- A logical string wrapped for use as an RFC 8187
ext-value, in header parameters likeContent-Disposition’sfilename*.
Enums§
- Decode
Error - The reasons a header value can fail to decode into a logical string.
Functions§
- decode_
header_ str - Decodes an escaped string back into its logical form.
- decode_
header_ value - Decodes a header value into the logical string it carries.
- encode_
header_ str - Escapes a logical string for a transport that is not an HTTP header.
- encode_
header_ value - Escapes a logical string into a header value.