Private HTTP QUERY media-type parsing and negotiation helpers.
http.query_media
| Name | Type | Default | Description |
|---|---|---|---|
type
|
|
— | |
qualified_name
|
|
— | |
element_type
|
|
— | |
description
|
|
— | |
source_file
|
|
— | |
line_number
|
|
— | |
is_autodoc
|
|
— | |
autodoc_element
|
|
— | |
_autodoc_template
|
|
— | |
_autodoc_url_path
|
|
— | |
_autodoc_page_type
|
|
— | |
title
|
|
— | |
doc_content_hash
|
|
— |
Symbols on this page
Validate and deterministically normalize a route declaration.
Serialize normalized media ranges as an RFC 9651 Structured Field List.
Return whether a request Content-Type matches a declared media range.
Apply HTTP Accept precedence to a selected response Content-Type.
_MediaRange
class
normalize_query_media_types
function
def normalize_query_media_types(values: tuple[str, ...]) -> tuple[str, ...]
Validate and deterministically normalize a route declaration.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
values
|
tuple[str, ...]
|
— |
serialize_accept_query
function
def serialize_accept_query(values: tuple[str, ...]) -> str
Serialize normalized media ranges as an RFC 9651 Structured Field List.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
values
|
tuple[str, ...]
|
— |
query_content_type_supported
function
def query_content_type_supported(content_type: str, supported: tuple[str, ...]) -> bool
Return whether a request Content-Type matches a declared media range.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
content_type
|
str
|
— | |
supported
|
tuple[str, ...]
|
— |
response_content_type_acceptable
function
def response_content_type_acceptable(content_type: str, accept: str | None) -> bool
Apply HTTP Accept precedence to a selected response Content-Type.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
content_type
|
str
|
— | |
accept
|
str | None
|
— |
View source · /home/runner/work/chirp/chirp/site/../src/chirp/http/query_media.py:1