Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

HttpX Client for Uplink

Project description

code formatting pypi badge

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.

Files for uplink-httpx, version 1.6
Filename, size File type Python version Upload date Hashes
Filename, size uplink_httpx-1.6-py3-none-any.whl (3.8 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size uplink-httpx-1.6.tar.gz (3.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page