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 |
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 |
|
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 |
|
Undocumented |
Class |
|
Undocumented |
Class |
|
An asynchronous HTTP client, with connection pooling, HTTP/2, redirects, cookie persistence, etc. |
Class |
|
Undocumented |
Class |
|
Base class for all authentication schemes. |
Class |
|
No class docstring; 1/4 method documented |
Class |
|
Allows the 'auth' argument to be passed as a (username, password) pair, and uses HTTP Basic authentication. |
Class |
|
Undocumented |
Class |
|
An HTTP client, with connection pooling, HTTP/2, redirects, cookie persistence, etc. |
Class | codes |
HTTP status codes and reason phrases |
Class |
|
HTTP Cookies, as a mutable mapping. |
Class |
|
No class docstring; 0/4 instance variable, 0/1 constant, 1/7 method documented |
Class |
|
HTTP headers, as a case-insensitive multi-dict. |
Class |
|
Undocumented |
Class |
|
Configuration for limits to various client behaviors. |
Class |
|
Undocumented |
Class |
|
Undocumented |
Class |
|
URL query parameters, as a multi-dict. |
Class |
|
No class docstring; 0/1 property, 0/6 instance variable, 2/7 methods documented |
Class |
|
No class docstring; 13/19 properties, 0/15 instance variable, 12/23 methods documented |
Class |
|
No class docstring; 1/2 method documented |
Class |
|
Timeout configuration. |
Class | URL |
url = httpx.URL("HTTPS://jo%40email.com:a%20secret@müller.de:1234/pa%20th?search=ab#anchorlink") |
Class |
|
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 |
|
Failed to close a connection. |
Exception |
|
Failed to establish a connection. |
Exception |
|
Timed out while connecting to the host. |
Exception |
|
Attempted to lookup a cookie by name, but multiple cookies existed. |
Exception |
|
Decoding of the response failed, due to a malformed encoding. |
Exception |
|
Base class for `RequestError` and `HTTPStatusError`. |
Exception |
|
The response had an error HTTP status of 4xx or 5xx. |
Exception |
|
URL is improperly formed or cannot be parsed. |
Exception |
|
A protocol was violated by the client. |
Exception |
|
The base class for network-related errors. |
Exception |
|
Timed out waiting to acquire a connection from the pool. |
Exception |
|
The protocol was violated. |
Exception |
|
An error occurred while establishing a proxy connection. |
Exception |
|
Failed to receive data from the network. |
Exception |
|
Timed out while receiving data from the host. |
Exception |
|
The protocol was violated by the server. |
Exception |
|
Base class for all exceptions that may occur when issuing a `.request()`. |
Exception |
|
Attempted to access streaming request content, without having called `read()`. |
Exception |
|
Attempted to access streaming response content, without having called `read()`. |
Exception |
|
Attempted to read or stream response content, but the request has been closed. |
Exception |
|
Attempted to read or stream content, but the content has already been streamed. |
Exception |
|
The base class for stream exceptions. |
Exception |
|
The base class for timeout errors. |
Exception |
|
Too many redirects. |
Exception |
|
Base class for all exceptions that occur at the level of the Transport API. |
Exception |
|
Attempted to make a request to an unsupported protocol. |
Exception |
|
Failed to send data through the network. |
Exception |
|
Timed out while sending data to the host. |
Function | create |
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 |
Undocumented |
Variable | __description__ |
Undocumented |
Variable | __title__ |
Undocumented |
Variable | __version__ |
Undocumented |
Variable | __locals |
Undocumented |
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:URLTypes | Undocumented |
params:typing.Optional[ | Undocumented |
headers:typing.Optional[ | Undocumented |
cookies:typing.Optional[ | Undocumented |
auth:typing.Optional[ | Undocumented |
proxies:typing.Optional[ | Undocumented |
followbool | Undocumented |
cert:typing.Optional[ | Undocumented |
verify:VerifyTypes | Undocumented |
timeout:TimeoutTypes | Undocumented |
trustbool | Undocumented |
Returns | |
Response | Undocumented |
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:URLTypes | Undocumented |
params:typing.Optional[ | Undocumented |
headers:typing.Optional[ | Undocumented |
cookies:typing.Optional[ | Undocumented |
auth:typing.Optional[ | Undocumented |
proxies:typing.Optional[ | Undocumented |
followbool | Undocumented |
cert:typing.Optional[ | Undocumented |
verify:VerifyTypes | Undocumented |
timeout:TimeoutTypes | Undocumented |
trustbool | Undocumented |
Returns | |
Response | Undocumented |
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:URLTypes | Undocumented |
params:typing.Optional[ | Undocumented |
headers:typing.Optional[ | Undocumented |
cookies:typing.Optional[ | Undocumented |
auth:typing.Optional[ | Undocumented |
proxies:typing.Optional[ | Undocumented |
followbool | Undocumented |
cert:typing.Optional[ | Undocumented |
verify:VerifyTypes | Undocumented |
timeout:TimeoutTypes | Undocumented |
trustbool | Undocumented |
Returns | |
Response | Undocumented |
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:URLTypes | Undocumented |
params:typing.Optional[ | Undocumented |
headers:typing.Optional[ | Undocumented |
cookies:typing.Optional[ | Undocumented |
auth:typing.Optional[ | Undocumented |
proxies:typing.Optional[ | Undocumented |
followbool | Undocumented |
cert:typing.Optional[ | Undocumented |
verify:VerifyTypes | Undocumented |
timeout:TimeoutTypes | Undocumented |
trustbool | Undocumented |
Returns | |
Response | Undocumented |
Sends a `PATCH` request. **Parameters**: See `httpx.request`.
Parameters | |
url:URLTypes | Undocumented |
content:typing.Optional[ | Undocumented |
data:typing.Optional[ | Undocumented |
files:typing.Optional[ | Undocumented |
json:typing.Optional[ | Undocumented |
params:typing.Optional[ | Undocumented |
headers:typing.Optional[ | Undocumented |
cookies:typing.Optional[ | Undocumented |
auth:typing.Optional[ | Undocumented |
proxies:typing.Optional[ | Undocumented |
followbool | Undocumented |
cert:typing.Optional[ | Undocumented |
verify:VerifyTypes | Undocumented |
timeout:TimeoutTypes | Undocumented |
trustbool | Undocumented |
Returns | |
Response | Undocumented |
Sends a `POST` request. **Parameters**: See `httpx.request`.
Parameters | |
url:URLTypes | Undocumented |
content:typing.Optional[ | Undocumented |
data:typing.Optional[ | Undocumented |
files:typing.Optional[ | Undocumented |
json:typing.Optional[ | Undocumented |
params:typing.Optional[ | Undocumented |
headers:typing.Optional[ | Undocumented |
cookies:typing.Optional[ | Undocumented |
auth:typing.Optional[ | Undocumented |
proxies:typing.Optional[ | Undocumented |
followbool | Undocumented |
cert:typing.Optional[ | Undocumented |
verify:VerifyTypes | Undocumented |
timeout:TimeoutTypes | Undocumented |
trustbool | Undocumented |
Returns | |
Response | Undocumented |
Sends a `PUT` request. **Parameters**: See `httpx.request`.
Parameters | |
url:URLTypes | Undocumented |
content:typing.Optional[ | Undocumented |
data:typing.Optional[ | Undocumented |
files:typing.Optional[ | Undocumented |
json:typing.Optional[ | Undocumented |
params:typing.Optional[ | Undocumented |
headers:typing.Optional[ | Undocumented |
cookies:typing.Optional[ | Undocumented |
auth:typing.Optional[ | Undocumented |
proxies:typing.Optional[ | Undocumented |
followbool | Undocumented |
cert:typing.Optional[ | Undocumented |
verify:VerifyTypes | Undocumented |
timeout:TimeoutTypes | Undocumented |
trustbool | Undocumented |
Returns | |
Response | Undocumented |
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:str | Undocumented |
url:URLTypes | Undocumented |
params:typing.Optional[ | Undocumented |
content:typing.Optional[ | Undocumented |
data:typing.Optional[ | Undocumented |
files:typing.Optional[ | Undocumented |
json:typing.Optional[ | Undocumented |
headers:typing.Optional[ | Undocumented |
cookies:typing.Optional[ | Undocumented |
auth:typing.Optional[ | Undocumented |
proxies:typing.Optional[ | Undocumented |
timeout:TimeoutTypes | Undocumented |
followbool | Undocumented |
verify:VerifyTypes | Undocumented |
cert:typing.Optional[ | Undocumented |
trustbool | Undocumented |
Returns | |
Response | Undocumented |
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:str | Undocumented |
url:URLTypes | Undocumented |
params:typing.Optional[ | Undocumented |
content:typing.Optional[ | Undocumented |
data:typing.Optional[ | Undocumented |
files:typing.Optional[ | Undocumented |
json:typing.Optional[ | Undocumented |
headers:typing.Optional[ | Undocumented |
cookies:typing.Optional[ | Undocumented |
auth:typing.Optional[ | Undocumented |
proxies:typing.Optional[ | Undocumented |
timeout:TimeoutTypes | Undocumented |
followbool | Undocumented |
verify:VerifyTypes | Undocumented |
cert:typing.Optional[ | Undocumented |
trustbool | Undocumented |
Returns | |
typing.Iterator[ | Undocumented |
Undocumented
Parameters | |
cert:typing.Optional[ | Undocumented |
verify:VerifyTypes | Undocumented |
trustbool | Undocumented |
http2:bool | Undocumented |
Returns | |
ssl.SSLContext | Undocumented |
@click.argument(
@click.option(
@click.option(
@click.option(
@click.option(
@click.option(
@click.option(
@click.option(
@click.option(
@click.option(
@click.option(
@click.option(
@click.option(
@click.option(
@click.option(
@click.option(
@click.option(
@click.option(
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:str | Undocumented |
method:str | Undocumented |
params:typing.List[ | Undocumented |
content:str | Undocumented |
data:typing.List[ | Undocumented |
files:typing.List[ | Undocumented |
json:str | Undocumented |
headers:typing.List[ | Undocumented |
cookies:typing.List[ | Undocumented |
auth:typing.Optional[ | Undocumented |
proxies:str | Undocumented |
timeout:float | Undocumented |
followbool | Undocumented |
verify:bool | Undocumented |
http2:bool | Undocumented |
download:typing.Optional[ | Undocumented |
verbose:bool | Undocumented |