module documentation

Undocumented

Class Logger Undocumented
Class NetRCInfo Undocumented
Class Timer Undocumented
Class URLPattern A utility class currently used for making lookups against proxy keys...
Function format_form_param Encode a name/value pair within a multipart form.
Function get_ca_bundle_from_env Undocumented
Function get_environment_proxies Gets proxy information from the environment
Function get_logger Get a `logging.Logger` instance, and optionally set up debug logging based on the HTTPX_LOG_LEVEL environment variable.
Function guess_content_type Undocumented
Function guess_json_utf Undocumented
Function is_https_redirect Return 'True' if 'location' is a HTTPS upgrade of 'url'
Function is_known_encoding Return `True` if `encoding` is a known codec.
Function normalize_header_key Coerce str/bytes into a strictly byte-wise HTTP header key.
Function normalize_header_value Coerce str/bytes into a strictly byte-wise HTTP header value.
Function obfuscate_sensitive_headers Undocumented
Function parse_content_type_charset Undocumented
Function parse_header_links Returns a list of parsed link headers, for more info see: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Link The generic syntax of those is: Link: < uri-reference >; param1=value1; param2="value2" So for instance: Link; '<http:/...
Function peek_filelike_length Given a file-like stream object, return its length in number of bytes without reading it into memory.
Function port_or_default Undocumented
Function primitive_value_to_str Coerce a primitive data type into a string value.
Function same_origin Return 'True' if the given URLs share the same origin.
Function to_bytes Undocumented
Function to_bytes_or_str Undocumented
Function to_str Undocumented
Function unquote Undocumented
Constant SENSITIVE_HEADERS Undocumented
Constant TRACE_LOG_LEVEL Undocumented
Constant _HTML5_FORM_ENCODING_RE Undocumented
Constant _HTML5_FORM_ENCODING_REPLACEMENTS Undocumented
Constant _LOGGER_INITIALIZED Undocumented
Variable _null Undocumented
Variable _null2 Undocumented
Variable _null3 Undocumented
def format_form_param(name, value): (source)

Encode a name/value pair within a multipart form.

Parameters
name:strUndocumented
value:strUndocumented
Returns
bytesUndocumented
def get_ca_bundle_from_env(): (source)

Undocumented

Returns
typing.Optional[str]Undocumented
def get_environment_proxies(): (source)

Gets proxy information from the environment

Returns
typing.Dict[str, typing.Optional[str]]Undocumented
def get_logger(name): (source)

Get a `logging.Logger` instance, and optionally set up debug logging based on the HTTPX_LOG_LEVEL environment variable.

Parameters
name:strUndocumented
Returns
LoggerUndocumented
def guess_content_type(filename): (source)

Undocumented

Parameters
filename:typing.Optional[str]Undocumented
Returns
typing.Optional[str]Undocumented
def guess_json_utf(data): (source)

Undocumented

Parameters
data:bytesUndocumented
Returns
typing.Optional[str]Undocumented
def is_https_redirect(url, location): (source)

Return 'True' if 'location' is a HTTPS upgrade of 'url'

Parameters
url:URLUndocumented
location:URLUndocumented
Returns
boolUndocumented
def is_known_encoding(encoding): (source)

Return `True` if `encoding` is a known codec.

Parameters
encoding:strUndocumented
Returns
boolUndocumented
def normalize_header_key(value, lower, encoding=None): (source)

Coerce str/bytes into a strictly byte-wise HTTP header key.

Parameters
value:typing.Union[str, bytes]Undocumented
lower:boolUndocumented
encoding:typing.Optional[str]Undocumented
Returns
bytesUndocumented
def normalize_header_value(value, encoding=None): (source)

Coerce str/bytes into a strictly byte-wise HTTP header value.

Parameters
value:typing.Union[str, bytes]Undocumented
encoding:typing.Optional[str]Undocumented
Returns
bytesUndocumented
def obfuscate_sensitive_headers(items): (source)

Undocumented

Parameters
items:typing.Iterable[typing.Tuple[typing.AnyStr, typing.AnyStr]]Undocumented
Returns
typing.Iterator[typing.Tuple[typing.AnyStr, typing.AnyStr]]Undocumented
def parse_content_type_charset(content_type): (source)

Undocumented

Parameters
content_type:strUndocumented
Returns
typing.Optional[str]Undocumented
def parse_header_links(value): (source)

Returns a list of parsed link headers, for more info see: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Link The generic syntax of those is: Link: < uri-reference >; param1=value1; param2="value2" So for instance: Link; '<http:/.../front.jpeg>; type="image/jpeg",<http://.../back.jpeg>;' would return [ {"url": "http:/.../front.jpeg", "type": "image/jpeg"}, {"url": "http://.../back.jpeg"}, ] :param value: HTTP Link entity-header field :return: list of parsed link headers

Parameters
value:strUndocumented
Returns
typing.List[typing.Dict[str, str]]Undocumented
def peek_filelike_length(stream): (source)

Given a file-like stream object, return its length in number of bytes without reading it into memory.

Parameters
stream:typing.AnyUndocumented
Returns
typing.Optional[int]Undocumented
def port_or_default(url): (source)

Undocumented

Parameters
url:URLUndocumented
Returns
typing.Optional[int]Undocumented
def primitive_value_to_str(value): (source)

Coerce a primitive data type into a string value. Note that we prefer JSON-style 'true'/'false' for boolean values here.

Parameters
value:PrimitiveDataUndocumented
Returns
strUndocumented
def same_origin(url, other): (source)

Return 'True' if the given URLs share the same origin.

Parameters
url:URLUndocumented
other:URLUndocumented
Returns
boolUndocumented
def to_bytes(value, encoding='utf-8'): (source)

Undocumented

Parameters
value:typing.Union[str, bytes]Undocumented
encoding:strUndocumented
Returns
bytesUndocumented
def to_bytes_or_str(value, match_type_of): (source)

Undocumented

Parameters
value:strUndocumented
match_type_of:typing.AnyStrUndocumented
Returns
typing.AnyStrUndocumented
def to_str(value, encoding='utf-8'): (source)

Undocumented

Parameters
value:typing.Union[str, bytes]Undocumented
encoding:strUndocumented
Returns
strUndocumented
def unquote(value): (source)

Undocumented

Parameters
value:strUndocumented
Returns
strUndocumented
SENSITIVE_HEADERS: set[str] = (source)

Undocumented

Value
set(['authorization', 'proxy-authorization'])
TRACE_LOG_LEVEL: int = (source)

Undocumented

Value
5
_HTML5_FORM_ENCODING_RE = (source)

Undocumented

Value
re.compile("""|""".join([re.escape(c) for c in _HTML5_FORM_ENCODING_REPLACEMENTS
.keys()]))
_HTML5_FORM_ENCODING_REPLACEMENTS: dict[str, str] = (source)

Undocumented

Value
{'"': '%22', '\\': '\\\\'}
_LOGGER_INITIALIZED: bool = (source)

Undocumented

Value
False

Undocumented

Undocumented

Undocumented