package documentation

Undocumented

Module _api Undocumented
Module _auth No module docstring; 1/2 class documented
Module _client No module docstring; 0/1 variable, 0/1 type alias, 0/2 type variable, 0/2 constant, 3/5 classes documented
Module _compat The _compat module is used for code which requires branching between different Python environments. It is excluded from the code coverage checks.
Module _config No module docstring; 0/1 variable, 0/5 constant, 1/2 class documented
Module _content No module docstring; 2/8 functions, 1/3 class documented
Module _decoders Handlers for Content-Encoding.
Module _exceptions Our exception hierarchy:
Module _main Undocumented
Module _models Undocumented
Module _multipart No module docstring; 0/1 function, 3/3 classes documented
Module _status_codes Undocumented
Package _transports No package docstring; 1/5 module documented
Module _types Type definitions for type checking purposes.
Module _urls Undocumented
Module _utils No module docstring; 0/3 variable, 0/5 constant, 11/21 functions, 1/4 class documented

From __init__.py:

Class ASGITransport A custom AsyncTransport that handles sending requests directly to an ASGI app. The simplest way to use this functionality is to use the `app` argument.
Class AsyncBaseTransport Undocumented
Class AsyncByteStream Undocumented
Class AsyncClient An asynchronous HTTP client, with connection pooling, HTTP/2, redirects, cookie persistence, etc.
Class AsyncHTTPTransport Undocumented
Class Auth Base class for all authentication schemes.
Class BaseTransport No class docstring; 1/4 method documented
Class BasicAuth Allows the 'auth' argument to be passed as a (username, password) pair, and uses HTTP Basic authentication.
Class ByteStream Undocumented
Class Client An HTTP client, with connection pooling, HTTP/2, redirects, cookie persistence, etc.
Class codes HTTP status codes and reason phrases
Class Cookies HTTP Cookies, as a mutable mapping.
Class DigestAuth No class docstring; 0/4 instance variable, 0/1 constant, 1/7 method documented
Class Headers HTTP headers, as a case-insensitive multi-dict.
Class HTTPTransport Undocumented
Class Limits Configuration for limits to various client behaviors.
Class MockTransport Undocumented
Class Proxy Undocumented
Class QueryParams URL query parameters, as a multi-dict.
Class Request No class docstring; 0/1 property, 0/6 instance variable, 2/7 methods documented
Class Response No class docstring; 13/19 properties, 0/15 instance variable, 12/23 methods documented
Class SyncByteStream No class docstring; 1/2 method documented
Class Timeout Timeout configuration.
Class URL url = httpx.URL("HTTPS://jo%40email.com:a%20secret@müller.de:1234/pa%20th?search=ab#anchorlink")
Class WSGITransport A custom transport that handles sending requests directly to an WSGI app. The simplest way to use this functionality is to use the `app` argument.
Exception CloseError Failed to close a connection.
Exception ConnectError Failed to establish a connection.
Exception ConnectTimeout Timed out while connecting to the host.
Exception CookieConflict Attempted to lookup a cookie by name, but multiple cookies existed.
Exception DecodingError Decoding of the response failed, due to a malformed encoding.
Exception HTTPError Base class for `RequestError` and `HTTPStatusError`.
Exception HTTPStatusError The response had an error HTTP status of 4xx or 5xx.
Exception InvalidURL URL is improperly formed or cannot be parsed.
Exception LocalProtocolError A protocol was violated by the client.
Exception NetworkError The base class for network-related errors.
Exception PoolTimeout Timed out waiting to acquire a connection from the pool.
Exception ProtocolError The protocol was violated.
Exception ProxyError An error occurred while establishing a proxy connection.
Exception ReadError Failed to receive data from the network.
Exception ReadTimeout Timed out while receiving data from the host.
Exception RemoteProtocolError The protocol was violated by the server.
Exception RequestError Base class for all exceptions that may occur when issuing a `.request()`.
Exception RequestNotRead Attempted to access streaming request content, without having called `read()`.
Exception ResponseNotRead Attempted to access streaming response content, without having called `read()`.
Exception StreamClosed Attempted to read or stream response content, but the request has been closed.
Exception StreamConsumed Attempted to read or stream content, but the content has already been streamed.
Exception StreamError The base class for stream exceptions.
Exception TimeoutException The base class for timeout errors.
Exception TooManyRedirects Too many redirects.
Exception TransportError Base class for all exceptions that occur at the level of the Transport API.
Exception UnsupportedProtocol Attempted to make a request to an unsupported protocol.
Exception WriteError Failed to send data through the network.
Exception WriteTimeout Timed out while sending data to the host.
Function create_ssl_context Undocumented
Function delete Sends a `DELETE` request.
Function get Sends a `GET` request.
Function head Sends a `HEAD` request.
Function main An HTTP command line client. Sends a request and displays the response.
Function options Sends an `OPTIONS` request.
Function patch Sends a `PATCH` request.
Function post Sends a `POST` request.
Function put Sends a `PUT` request.
Function request Sends an HTTP request.
Function stream Alternative to `httpx.request()` that streams the response body instead of loading it into memory at once.
Constant USE_CLIENT_DEFAULT Undocumented
Variable __description__ Undocumented
Variable __title__ Undocumented
Variable __version__ Undocumented
Variable __locals Undocumented
__version__: str = (source)

Undocumented

__description__: str = (source)

Undocumented

__title__: str = (source)

Undocumented

def delete(url, *, params=None, headers=None, cookies=None, auth=None, proxies=None, follow_redirects=False, cert=None, verify=True, timeout=DEFAULT_TIMEOUT_CONFIG, trust_env=True): (source)

Sends a `DELETE` request. **Parameters**: See `httpx.request`. Note that the `data`, `files`, `json` and `content` parameters are not available on this function, as `DELETE` requests should not include a request body.

Parameters
url:URLTypesUndocumented
params:typing.Optional[QueryParamTypes]Undocumented
headers:typing.Optional[HeaderTypes]Undocumented
cookies:typing.Optional[CookieTypes]Undocumented
auth:typing.Optional[AuthTypes]Undocumented
proxies:typing.Optional[ProxiesTypes]Undocumented
follow_redirects:boolUndocumented
cert:typing.Optional[CertTypes]Undocumented
verify:VerifyTypesUndocumented
timeout:TimeoutTypesUndocumented
trust_env:boolUndocumented
Returns
ResponseUndocumented
def get(url, *, params=None, headers=None, cookies=None, auth=None, proxies=None, follow_redirects=False, cert=None, verify=True, timeout=DEFAULT_TIMEOUT_CONFIG, trust_env=True): (source)

Sends a `GET` request. **Parameters**: See `httpx.request`. Note that the `data`, `files`, `json` and `content` parameters are not available on this function, as `GET` requests should not include a request body.

Parameters
url:URLTypesUndocumented
params:typing.Optional[QueryParamTypes]Undocumented
headers:typing.Optional[HeaderTypes]Undocumented
cookies:typing.Optional[CookieTypes]Undocumented
auth:typing.Optional[AuthTypes]Undocumented
proxies:typing.Optional[ProxiesTypes]Undocumented
follow_redirects:boolUndocumented
cert:typing.Optional[CertTypes]Undocumented
verify:VerifyTypesUndocumented
timeout:TimeoutTypesUndocumented
trust_env:boolUndocumented
Returns
ResponseUndocumented
def head(url, *, params=None, headers=None, cookies=None, auth=None, proxies=None, follow_redirects=False, cert=None, verify=True, timeout=DEFAULT_TIMEOUT_CONFIG, trust_env=True): (source)

Sends a `HEAD` request. **Parameters**: See `httpx.request`. Note that the `data`, `files`, `json` and `content` parameters are not available on this function, as `HEAD` requests should not include a request body.

Parameters
url:URLTypesUndocumented
params:typing.Optional[QueryParamTypes]Undocumented
headers:typing.Optional[HeaderTypes]Undocumented
cookies:typing.Optional[CookieTypes]Undocumented
auth:typing.Optional[AuthTypes]Undocumented
proxies:typing.Optional[ProxiesTypes]Undocumented
follow_redirects:boolUndocumented
cert:typing.Optional[CertTypes]Undocumented
verify:VerifyTypesUndocumented
timeout:TimeoutTypesUndocumented
trust_env:boolUndocumented
Returns
ResponseUndocumented
def options(url, *, params=None, headers=None, cookies=None, auth=None, proxies=None, follow_redirects=False, cert=None, verify=True, timeout=DEFAULT_TIMEOUT_CONFIG, trust_env=True): (source)

Sends an `OPTIONS` request. **Parameters**: See `httpx.request`. Note that the `data`, `files`, `json` and `content` parameters are not available on this function, as `OPTIONS` requests should not include a request body.

Parameters
url:URLTypesUndocumented
params:typing.Optional[QueryParamTypes]Undocumented
headers:typing.Optional[HeaderTypes]Undocumented
cookies:typing.Optional[CookieTypes]Undocumented
auth:typing.Optional[AuthTypes]Undocumented
proxies:typing.Optional[ProxiesTypes]Undocumented
follow_redirects:boolUndocumented
cert:typing.Optional[CertTypes]Undocumented
verify:VerifyTypesUndocumented
timeout:TimeoutTypesUndocumented
trust_env:boolUndocumented
Returns
ResponseUndocumented
def patch(url, *, content=None, data=None, files=None, json=None, params=None, headers=None, cookies=None, auth=None, proxies=None, follow_redirects=False, cert=None, verify=True, timeout=DEFAULT_TIMEOUT_CONFIG, trust_env=True): (source)

Sends a `PATCH` request. **Parameters**: See `httpx.request`.

Parameters
url:URLTypesUndocumented
content:typing.Optional[RequestContent]Undocumented
data:typing.Optional[RequestData]Undocumented
files:typing.Optional[RequestFiles]Undocumented
json:typing.Optional[typing.Any]Undocumented
params:typing.Optional[QueryParamTypes]Undocumented
headers:typing.Optional[HeaderTypes]Undocumented
cookies:typing.Optional[CookieTypes]Undocumented
auth:typing.Optional[AuthTypes]Undocumented
proxies:typing.Optional[ProxiesTypes]Undocumented
follow_redirects:boolUndocumented
cert:typing.Optional[CertTypes]Undocumented
verify:VerifyTypesUndocumented
timeout:TimeoutTypesUndocumented
trust_env:boolUndocumented
Returns
ResponseUndocumented
def post(url, *, content=None, data=None, files=None, json=None, params=None, headers=None, cookies=None, auth=None, proxies=None, follow_redirects=False, cert=None, verify=True, timeout=DEFAULT_TIMEOUT_CONFIG, trust_env=True): (source)

Sends a `POST` request. **Parameters**: See `httpx.request`.

Parameters
url:URLTypesUndocumented
content:typing.Optional[RequestContent]Undocumented
data:typing.Optional[RequestData]Undocumented
files:typing.Optional[RequestFiles]Undocumented
json:typing.Optional[typing.Any]Undocumented
params:typing.Optional[QueryParamTypes]Undocumented
headers:typing.Optional[HeaderTypes]Undocumented
cookies:typing.Optional[CookieTypes]Undocumented
auth:typing.Optional[AuthTypes]Undocumented
proxies:typing.Optional[ProxiesTypes]Undocumented
follow_redirects:boolUndocumented
cert:typing.Optional[CertTypes]Undocumented
verify:VerifyTypesUndocumented
timeout:TimeoutTypesUndocumented
trust_env:boolUndocumented
Returns
ResponseUndocumented
def put(url, *, content=None, data=None, files=None, json=None, params=None, headers=None, cookies=None, auth=None, proxies=None, follow_redirects=False, cert=None, verify=True, timeout=DEFAULT_TIMEOUT_CONFIG, trust_env=True): (source)

Sends a `PUT` request. **Parameters**: See `httpx.request`.

Parameters
url:URLTypesUndocumented
content:typing.Optional[RequestContent]Undocumented
data:typing.Optional[RequestData]Undocumented
files:typing.Optional[RequestFiles]Undocumented
json:typing.Optional[typing.Any]Undocumented
params:typing.Optional[QueryParamTypes]Undocumented
headers:typing.Optional[HeaderTypes]Undocumented
cookies:typing.Optional[CookieTypes]Undocumented
auth:typing.Optional[AuthTypes]Undocumented
proxies:typing.Optional[ProxiesTypes]Undocumented
follow_redirects:boolUndocumented
cert:typing.Optional[CertTypes]Undocumented
verify:VerifyTypesUndocumented
timeout:TimeoutTypesUndocumented
trust_env:boolUndocumented
Returns
ResponseUndocumented
def request(method, url, *, params=None, content=None, data=None, files=None, json=None, headers=None, cookies=None, auth=None, proxies=None, timeout=DEFAULT_TIMEOUT_CONFIG, follow_redirects=False, verify=True, cert=None, trust_env=True): (source)

Sends an HTTP request. **Parameters:** * **method** - HTTP method for the new `Request` object: `GET`, `OPTIONS`, `HEAD`, `POST`, `PUT`, `PATCH`, or `DELETE`. * **url** - URL for the new `Request` object. * **params** - *(optional)* Query parameters to include in the URL, as a string, dictionary, or sequence of two-tuples. * **content** - *(optional)* Binary content to include in the body of the request, as bytes or a byte iterator. * **data** - *(optional)* Form data to include in the body of the request, as a dictionary. * **files** - *(optional)* A dictionary of upload files to include in the body of the request. * **json** - *(optional)* A JSON serializable object to include in the body of the request. * **headers** - *(optional)* Dictionary of HTTP headers to include in the request. * **cookies** - *(optional)* Dictionary of Cookie items to include in the request. * **auth** - *(optional)* An authentication class to use when sending the request. * **proxies** - *(optional)* A dictionary mapping proxy keys to proxy URLs. * **timeout** - *(optional)* The timeout configuration to use when sending the request. * **follow_redirects** - *(optional)* Enables or disables HTTP redirects. * **verify** - *(optional)* SSL certificates (a.k.a CA bundle) used to verify the identity of requested hosts. Either `True` (default CA bundle), a path to an SSL certificate file, an `ssl.SSLContext`, or `False` (which will disable verification). * **cert** - *(optional)* An SSL certificate used by the requested host to authenticate the client. Either a path to an SSL certificate file, or two-tuple of (certificate file, key file), or a three-tuple of (certificate file, key file, password). * **trust_env** - *(optional)* Enables or disables usage of environment variables for configuration. **Returns:** `Response` Usage: ``` >>> import httpx >>> response = httpx.request('GET', 'https://httpbin.org/get') >>> response <Response [200 OK]> ```

Parameters
method:strUndocumented
url:URLTypesUndocumented
params:typing.Optional[QueryParamTypes]Undocumented
content:typing.Optional[RequestContent]Undocumented
data:typing.Optional[RequestData]Undocumented
files:typing.Optional[RequestFiles]Undocumented
json:typing.Optional[typing.Any]Undocumented
headers:typing.Optional[HeaderTypes]Undocumented
cookies:typing.Optional[CookieTypes]Undocumented
auth:typing.Optional[AuthTypes]Undocumented
proxies:typing.Optional[ProxiesTypes]Undocumented
timeout:TimeoutTypesUndocumented
follow_redirects:boolUndocumented
verify:VerifyTypesUndocumented
cert:typing.Optional[CertTypes]Undocumented
trust_env:boolUndocumented
Returns
ResponseUndocumented
@contextmanager
def stream(method, url, *, params=None, content=None, data=None, files=None, json=None, headers=None, cookies=None, auth=None, proxies=None, timeout=DEFAULT_TIMEOUT_CONFIG, follow_redirects=False, verify=True, cert=None, trust_env=True): (source)

Alternative to `httpx.request()` that streams the response body instead of loading it into memory at once. **Parameters**: See `httpx.request`. See also: [Streaming Responses][0] [0]: /quickstart#streaming-responses

Parameters
method:strUndocumented
url:URLTypesUndocumented
params:typing.Optional[QueryParamTypes]Undocumented
content:typing.Optional[RequestContent]Undocumented
data:typing.Optional[RequestData]Undocumented
files:typing.Optional[RequestFiles]Undocumented
json:typing.Optional[typing.Any]Undocumented
headers:typing.Optional[HeaderTypes]Undocumented
cookies:typing.Optional[CookieTypes]Undocumented
auth:typing.Optional[AuthTypes]Undocumented
proxies:typing.Optional[ProxiesTypes]Undocumented
timeout:TimeoutTypesUndocumented
follow_redirects:boolUndocumented
verify:VerifyTypesUndocumented
cert:typing.Optional[CertTypes]Undocumented
trust_env:boolUndocumented
Returns
typing.Iterator[Response]Undocumented
USE_CLIENT_DEFAULT = (source)

Undocumented

Value
UseClientDefault()
def create_ssl_context(cert=None, verify=True, trust_env=True, http2=False): (source)

Undocumented

Parameters
cert:typing.Optional[CertTypes]Undocumented
verify:VerifyTypesUndocumented
trust_env:boolUndocumented
http2:boolUndocumented
Returns
ssl.SSLContextUndocumented
@click.command(add_help_option=False)
@click.argument('url', type=str)
@click.option('--method', '-m', 'method', type=str, help='Request method, such as GET, POST, PUT, PATCH, DELETE, OPTIONS, HEAD. [Default: GET, or POST if a request body is included]')
@click.option('--params', '-p', 'params', type=(str, str), multiple=True, help='Query parameters to include in the request URL.')
@click.option('--content', '-c', 'content', type=str, help='Byte content to include in the request body.')
@click.option('--data', '-d', 'data', type=(str, str), multiple=True, help='Form data to include in the request body.')
@click.option('--files', '-f', 'files', type=(str, click.File(mode='rb')), multiple=True, help='Form files to include in the request body.')
@click.option('--json', '-j', 'json', type=str, callback=validate_json, help='JSON data to include in the request body.')
@click.option('--headers', '-h', 'headers', type=(str, str), multiple=True, help='Include additional HTTP headers in the request.')
@click.option('--cookies', 'cookies', type=(str, str), multiple=True, help='Cookies to include in the request.')
@click.option('--auth', 'auth', type=(str, str), default=(None, None), callback=validate_auth, help='Username and password to include in the request. Specify \'-\' for the password to use a password prompt. Note that using --verbose/-v will expose the Authorization header, including the password encoding in a trivially reversible format.')
@click.option('--proxies', 'proxies', type=str, default=None, help='Send the request via a proxy. Should be the URL giving the proxy address.')
@click.option('--timeout', 'timeout', type=float, default=5.0, help='Timeout value to use for network operations, such as establishing the connection, reading some data, etc... [Default: 5.0]')
@click.option('--follow-redirects', 'follow_redirects', is_flag=True, default=False, help='Automatically follow redirects.')
@click.option('--no-verify', 'verify', is_flag=True, default=True, help='Disable SSL verification.')
@click.option('--http2', 'http2', type=bool, is_flag=True, default=False, help='Send the request using HTTP/2, if the remote server supports it.')
@click.option('--download', type=click.File('wb'), help='Save the response content as a file, rather than displaying it.')
@click.option('--verbose', '-v', type=bool, is_flag=True, default=False, help='Verbose. Show request as well as response.')
@click.option('--help', is_flag=True, is_eager=True, expose_value=False, callback=handle_help, help='Show this message and exit.')
def main(url, method, params, content, data, files, json, headers, cookies, auth, proxies, timeout, follow_redirects, verify, http2, download, verbose): (source)

An HTTP command line client. Sends a request and displays the response.

Parameters
url:strUndocumented
method:strUndocumented
params:typing.List[typing.Tuple[str, str]]Undocumented
content:strUndocumented
data:typing.List[typing.Tuple[str, str]]Undocumented
files:typing.List[typing.Tuple[str, click.File]]Undocumented
json:strUndocumented
headers:typing.List[typing.Tuple[str, str]]Undocumented
cookies:typing.List[typing.Tuple[str, str]]Undocumented
auth:typing.Optional[typing.Tuple[str, str]]Undocumented
proxies:strUndocumented
timeout:floatUndocumented
follow_redirects:boolUndocumented
verify:boolUndocumented
http2:boolUndocumented
download:typing.Optional[typing.BinaryIO]Undocumented
verbose:boolUndocumented
__locals = (source)

Undocumented