HttpX Client for Uplink
Project description
uplink-httpx
Uplink-Httpx is an asynchronous HTTP client based on HTTPX for the awesome Uplink REST library.
Use it like any other HTTP client for uplink.
import asyncio
import uplink
from uplink_httpx import HttpxClient
@uplink.headers({"Accept": "application/json"})
@uplink.returns.json()
class HttpBin(uplink.Consumer):
@uplink.get("get")
def get(self):
pass
async def demo():
httpbin = HttpBin(base_url="https://httpbin.org", client=HttpxClient())
resp = await httpbin.get()
print(resp)
# {'args': {}, 'headers': {'Accept': 'application/json', 'Accept-Encoding': 'gzip, deflate', 'Host': 'httpbin.org', 'User-Agent': 'python-httpx/0.9.5'}, ... 'url': 'https://httpbin.org/get'}
loop = asyncio.get_event_loop()
loop.run_until_complete(demo())
Features
HTTPX builds on the well-established usability of requests, and gives you:
- A requests-compatible API wherever possible. No issues between async and sync clients anymore.
- HTTP/2 and HTTP/1.1 support.
- Strict timeouts everywhere.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
uplink-httpx-1.1.tar.gz
(2.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file uplink-httpx-1.1.tar.gz.
File metadata
- Download URL: uplink-httpx-1.1.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2.post20191203 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.6.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6bfc5251918605868da565d1751bdf8625770f681f057e8f06f72a60127be3ab
|
|
| MD5 |
cd6427afb5ec7aef58a1dee50ea215af
|
|
| BLAKE2b-256 |
7d100cc3164e3149f1e9ae8124f30534de1a76bb38e1ece7dbd208277f9e904b
|
File details
Details for the file uplink_httpx-1.1-py3-none-any.whl.
File metadata
- Download URL: uplink_httpx-1.1-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2.post20191203 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.6.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77f36da9b2640b22ee0d67f1d0488d585393c02054e3713ec7250e4a66b6753b
|
|
| MD5 |
e8f941c1966c09a4f7f6214de1c9ba31
|
|
| BLAKE2b-256 |
ab26a9f03be41cbbe8c7df3710baa0147222d29988bce6210195e9307b66ec2c
|