Header catalog¶
Every header class exported from http_fields, grouped by function. All are frozen dataclasses
sharing the same contract:
Header.parse(value)— validate and parse a raw header value.direct construction from the header’s fields (scalars coerce; list headers take varargs).
str(),bytes(),.value,.asgi_valuefor output.immutable, comparable, hashable.
A handful expose extra constructors — see Special constructors below.
Content negotiation¶
Header |
Spec |
Notes |
|---|---|---|
|
RFC 9110 |
media ranges with weights |
|
RFC 9110 |
charsets with weights |
|
RFC 9110 |
content codings with weights |
|
RFC 9110 |
language ranges with weights |
|
RFC 9110 |
supported range units |
|
RFC 9110 |
field names, or |
Representation metadata¶
Header |
Spec |
Notes |
|---|---|---|
|
RFC 9110 |
media type; builder |
|
RFC 9110 |
content codings |
|
RFC 9110 |
language tags |
|
RFC 9110 |
|
|
RFC 9110 |
a URI |
|
RFC 9110 |
range unit + positions |
|
RFC 6266 |
type + params; builder |
Validators and conditionals¶
Header |
Spec |
Notes |
|---|---|---|
|
RFC 9110 |
an entity-tag; builder |
|
RFC 9110 |
a |
|
RFC 9110 |
entity-tags, or |
|
RFC 9110 |
a |
|
RFC 9110 |
an |
Range requests¶
Header |
Spec |
Notes |
|---|---|---|
|
RFC 9110 |
range unit + |
Caching¶
Header |
Spec |
Notes |
|---|---|---|
|
RFC 9111 |
|
|
RFC 9111 |
cache directives |
|
RFC 9111 |
a |
Authentication¶
Header |
Spec |
Notes |
|---|---|---|
|
RFC 9110 |
challenges |
|
RFC 9110 |
credentials |
|
RFC 9110 |
auth-params |
Connection management¶
Header |
Spec |
Notes |
|---|---|---|
|
RFC 9110 |
hostname + optional port |
|
RFC 9110 |
connection options |
|
RFC 9110 |
protocols |
|
RFC 9110 |
intermediaries |
|
RFC 9110 |
field names |
|
RFC 9110 |
transfer codings with weights |
|
RFC 9110 |
|
Request context¶
Header |
Spec |
Notes |
|---|---|---|
|
RFC 9110 |
a mailbox |
|
RFC 9110 |
a URI |
|
RFC 9110 |
products / comments |
|
RFC 9110 |
expectations (usually |
Response context¶
Header |
Spec |
Notes |
|---|---|---|
|
RFC 9110 |
methods |
|
RFC 9110 |
a |
|
RFC 9110 |
a URI |
|
RFC 9110 |
|
|
RFC 9110 |
products / comments |
CORS / Fetch¶
Header |
Spec |
Notes |
|---|---|---|
|
RFC 6454 / Fetch |
an origin |
|
Fetch |
origin, |
|
Fetch |
always |
|
Fetch |
methods |
|
Fetch |
field names |
|
Fetch |
|
|
Fetch |
a single method |
Other extensions¶
Header |
Spec |
Notes |
|---|---|---|
|
RFC 7239 |
forwarding elements |
|
RFC 8288 |
link values |
|
RFC 6797 |
|
|
RFC 7838 |
alternative services ( |
|
RFC 7240 |
preferences |
Structured Fields (RFC 9651)¶
See also Work with Structured Fields.
Header |
Spec |
Notes |
|---|---|---|
|
RFC 9218 |
|
|
RFC 9211 |
SF List of cache entries |
|
RFC 9209 |
SF List of intermediaries |
|
RFC 9530 |
SF Dictionary of algorithm → digest |
Generic¶
Header |
Notes |
|---|---|
|
any header with an arbitrary field name; |
Special constructors¶
Beyond .parse() and direct construction:
Header |
Constructor |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|