package documentation

Undocumented

Module connection No module docstring; 0/1 constant, 3/4 functions documented
Module proxy No module docstring; 2/2 functions documented
Module queue Undocumented
Module request No module docstring; 0/2 constant, 2/2 functions documented
Module response No module docstring; 2/2 functions documented
Module retry Undocumented
Module ssl_ No module docstring; 0/2 variable, 0/2 constant, 4/5 functions documented
Module ssl_match_hostname The match_hostname() function from Python 3.3.3, essential when using SSL.
Module ssltransport No module docstring; 0/1 constant, 1/1 class documented
Module timeout Undocumented
Module url No module docstring; 0/3 variable, 0/26 constant, 2/5 functions documented
Module wait No module docstring; 2/8 functions, 0/1 exception documented

From __init__.py:

Class Url Data structure for representing an HTTP URL. Used as a return value for :func:`parse_url`. Both the scheme and host are normalized as they are both case-insensitive according to RFC 3986.
Function assert_fingerprint Checks if given fingerprint matches the supplied certificate.
Function is_connection_dropped Returns True if the connection is dropped and should be closed.
Function is_fp_closed Checks whether a given file-like object is closed.
Function parse_url Given a url, return a parsed :class:`.Url` namedtuple. Best-effort is performed to parse incomplete urls. Fields not provided will be None. This parser is RFC 3986 and RFC 6874 compliant.
Function resolve_cert_reqs Resolves the argument to a numeric constant, which can be passed to the wrap_socket function/method from the ssl module. Defaults to :data:`ssl.CERT_REQUIRED`. If given a string it is assumed to be the name of the constant in the :mod:`ssl` module or its abbreviation...
Function resolve_ssl_version like resolve_cert_reqs
Function split_first .. deprecated:: 1.25
Function ssl_wrap_socket All arguments except for server_hostname, ssl_context, and ca_cert_dir have the same meaning as they do when using :func:`ssl.wrap_socket`.
Constant ALPN_PROTOCOLS Undocumented
Constant HAS_SNI Undocumented
Constant IS_PYOPENSSL Undocumented
Constant IS_SECURETRANSPORT Undocumented
Constant SKIP_HEADER Undocumented
Constant SKIPPABLE_HEADERS Undocumented
Variable current_time Undocumented
Variable SSLContext Undocumented
def is_connection_dropped(conn): (source)

Returns True if the connection is dropped and should be closed. :param conn: :class:`http.client.HTTPConnection` object. Note: For platforms like AppEngine, this will always return ``False`` to let the platform handle connection recycling transparently for us.

SKIP_HEADER: str = (source)

Undocumented

Value
'@@@SKIP_HEADER@@@'
SKIPPABLE_HEADERS = (source)

Undocumented

Value
frozenset(['accept-encoding', 'host', 'user-agent'])
def is_fp_closed(obj): (source)

Checks whether a given file-like object is closed. :param obj: The file-like object to check.

ALPN_PROTOCOLS: list[str] = (source)

Undocumented

Value
['http/1.1']

Undocumented

Value
False
IS_PYOPENSSL: bool = (source)

Undocumented

Value
False
IS_SECURETRANSPORT: bool = (source)

Undocumented

Value
False
SSLContext = (source)

Undocumented

def assert_fingerprint(cert, fingerprint): (source)

Checks if given fingerprint matches the supplied certificate. :param cert: Certificate as bytes object. :param fingerprint: Fingerprint as string of hexdigits, can be interspersed by colons.

def resolve_cert_reqs(candidate): (source)

Resolves the argument to a numeric constant, which can be passed to the wrap_socket function/method from the ssl module. Defaults to :data:`ssl.CERT_REQUIRED`. If given a string it is assumed to be the name of the constant in the :mod:`ssl` module or its abbreviation. (So you can specify `REQUIRED` instead of `CERT_REQUIRED`. If it's neither `None` nor a string we assume it is already the numeric constant which can directly be passed to wrap_socket.

def resolve_ssl_version(candidate): (source)

like resolve_cert_reqs

def ssl_wrap_socket(sock, keyfile=None, certfile=None, cert_reqs=None, ca_certs=None, server_hostname=None, ssl_version=None, ciphers=None, ssl_context=None, ca_cert_dir=None, key_password=None, ca_cert_data=None, tls_in_tls=False): (source)

All arguments except for server_hostname, ssl_context, and ca_cert_dir have the same meaning as they do when using :func:`ssl.wrap_socket`. :param server_hostname: When SNI is supported, the expected hostname of the certificate :param ssl_context: A pre-made :class:`SSLContext` object. If none is provided, one will be created using :func:`create_urllib3_context`. :param ciphers: A string of ciphers we wish the client to support. :param ca_cert_dir: A directory containing CA certificates in multiple separate files, as supported by OpenSSL's -CApath flag or the capath argument to SSLContext.load_verify_locations(). :param key_password: Optional password if the keyfile is encrypted. :param ca_cert_data: Optional string containing CA certificates in PEM format suitable for passing as the cadata parameter to SSLContext.load_verify_locations() :param tls_in_tls: Use SSLTransport to wrap the existing socket.

current_time = (source)

Undocumented

def parse_url(url): (source)

Given a url, return a parsed :class:`.Url` namedtuple. Best-effort is performed to parse incomplete urls. Fields not provided will be None. This parser is RFC 3986 and RFC 6874 compliant. The parser logic and helper functions are based heavily on work done in the ``rfc3986`` module. :param str url: URL to parse into a :class:`.Url` namedtuple. Partly backwards-compatible with :mod:`urlparse`. Example:: >>> parse_url('http://google.com/mail/') Url(scheme='http', host='google.com', port=None, path='/mail/', ...) >>> parse_url('google.com:80') Url(scheme=None, host='google.com', port=80, path=None, ...) >>> parse_url('/foo?bar') Url(scheme=None, host=None, port=None, path='/foo', query='bar', ...)

def split_first(s, delims): (source)

.. deprecated:: 1.25 Given a string and an iterable of delimiters, split on the first found delimiter. Return two split parts and the matched delimiter. If not found, then the first part is the full input string. Example:: >>> split_first('foo/bar?baz', '?/=') ('foo', 'bar?baz', '/') >>> split_first('foo/bar?baz', '123') ('foo/bar?baz', '', None) Scales linearly with number of delims. Not ideal for large number of delims.