All Projects → encode → Httpx

encode / Httpx

Licence: bsd-3-clause
A next generation HTTP client for Python. 🦋

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to Httpx

Dnspython
a powerful DNS toolkit for python
Stars: ✭ 1,838 (-77.17%)
Mutual labels:  asyncio, trio
fastapi-azure-auth
Easy and secure implementation of Azure AD for your FastAPI APIs 🔒 B2C, single- and multi-tenant support.
Stars: ✭ 174 (-97.84%)
Mutual labels:  asyncio, trio
sniffio
Sniff out which async library your code is running under
Stars: ✭ 75 (-99.07%)
Mutual labels:  asyncio, trio
hypercorn-fastapi-docker
Docker image with Hypercorn for FastAPI apps in Python 3.7, 3.8, 3.9. Ready for HTTP2 and HTTPS
Stars: ✭ 18 (-99.78%)
Mutual labels:  asyncio, trio
python-socks
Core proxy client (SOCKS4, SOCKS5, HTTP) functionality for Python
Stars: ✭ 40 (-99.5%)
Mutual labels:  asyncio, trio
asyncer
Asyncer, async and await, focused on developer experience.
Stars: ✭ 572 (-92.9%)
Mutual labels:  asyncio, trio
Aioquic
QUIC and HTTP/3 implementation in Python
Stars: ✭ 600 (-92.55%)
Mutual labels:  asyncio
Cryptofeed
Cryptocurrency Exchange Websocket Data Feed Handler
Stars: ✭ 643 (-92.01%)
Mutual labels:  asyncio
Easy Scraping Tutorial
Simple but useful Python web scraping tutorial code.
Stars: ✭ 583 (-92.76%)
Mutual labels:  asyncio
Opsdroid
🤖 An open source chat-ops bot framework
Stars: ✭ 563 (-93.01%)
Mutual labels:  asyncio
Nonocaptcha
An asynchronized Python library to automate solving ReCAPTCHA v2 using audio
Stars: ✭ 744 (-90.76%)
Mutual labels:  asyncio
Python Proxy
HTTP/HTTP2/HTTP3/Socks4/Socks5/Shadowsocks/ShadowsocksR/SSH/Redirect/Pf TCP/UDP asynchronous tunnel proxy implemented in Python 3 asyncio.
Stars: ✭ 692 (-91.41%)
Mutual labels:  asyncio
Gevent
Coroutine-based concurrency library for Python
Stars: ✭ 5,656 (-29.76%)
Mutual labels:  asyncio
Peewee Async
Asynchronous interface for peewee ORM powered by asyncio
Stars: ✭ 607 (-92.46%)
Mutual labels:  asyncio
Hivemind
Decentralized deep learning in PyTorch. Built to train models on thousands of volunteers across the world.
Stars: ✭ 661 (-91.79%)
Mutual labels:  asyncio
Yappi
Yet Another Python Profiler, but this time thread&coroutine&greenlet aware.
Stars: ✭ 595 (-92.61%)
Mutual labels:  asyncio
Tartiflette
GraphQL Engine built with Python 3.6+ / asyncio
Stars: ✭ 719 (-91.07%)
Mutual labels:  asyncio
Aredis
redis client for Python asyncio (has support for redis server, sentinel and cluster)
Stars: ✭ 576 (-92.85%)
Mutual labels:  asyncio
Aiobotocore
asyncio support for botocore library using aiohttp
Stars: ✭ 630 (-92.18%)
Mutual labels:  asyncio
Arq
Fast job queuing and RPC in python with asyncio and redis.
Stars: ✭ 695 (-91.37%)
Mutual labels:  asyncio

HTTPX

HTTPX - A next-generation HTTP client for Python.

Test Suite Package version

HTTPX is a fully featured HTTP client library for Python 3. It includes an integrated command line client, has support for both HTTP/1.1 and HTTP/2, and provides both sync and async APIs.

Note: The 0.21 release includes some improvements to the integrated command-line client. This latest version integrates against a re-designed version of httpcore. Both packages ought to automatically update to the required versions, but if you are seeing any issues then you should ensure that you have httpx==0.21.* and httpcore==0.14.* installed. See the CHANGELOG for more details.


Install HTTPX using pip:

$ pip install httpx

Now, let's get started:

>>> import httpx
>>> r = httpx.get('https://www.example.org/')
>>> r
<Response [200 OK]>
>>> r.status_code
200
>>> r.headers['content-type']
'text/html; charset=UTF-8'
>>> r.text
'<!doctype html>\n<html>\n<head>\n<title>Example Domain</title>...'

Or, using the command-line client.

$ pip install 'httpx[cli]'  # The command line client is an optional dependency.

Which now allows us to use HTTPX directly from the command-line...

httpx --help

Sending a request...

httpx http://httpbin.org/json

Features

HTTPX builds on the well-established usability of requests, and gives you:

Plus all the standard features of requests...

  • International Domains and URLs
  • Keep-Alive & Connection Pooling
  • Sessions with Cookie Persistence
  • Browser-style SSL Verification
  • Basic/Digest Authentication
  • Elegant Key/Value Cookies
  • Automatic Decompression
  • Automatic Content Decoding
  • Unicode Response Bodies
  • Multipart File Uploads
  • HTTP(S) Proxy Support
  • Connection Timeouts
  • Streaming Downloads
  • .netrc Support
  • Chunked Requests

Installation

Install with pip:

$ pip install httpx

Or, to include the optional HTTP/2 support, use:

$ pip install httpx[http2]

HTTPX requires Python 3.6+.

Documentation

Project documentation is available at https://www.python-httpx.org/.

For a run-through of all the basics, head over to the QuickStart.

For more advanced topics, see the Advanced Usage section, the async support section, or the HTTP/2 section.

The Developer Interface provides a comprehensive API reference.

To find out about tools that integrate with HTTPX, see Third Party Packages.

Contribute

If you want to contribute with HTTPX check out the Contributing Guide to learn how to start.

Dependencies

The HTTPX project relies on these excellent libraries:

  • httpcore - The underlying transport implementation for httpx.
    • h11 - HTTP/1.1 support.
    • h2 - HTTP/2 support. (Optional, with httpx[http2])
  • certifi - SSL certificates.
  • charset_normalizer - Charset auto-detection.
  • rfc3986 - URL parsing & normalization.
    • idna - Internationalized domain name support.
  • sniffio - Async library autodetection.
  • rich - Rich terminal support. (Optional, with httpx[cli])
  • click - Command line client support. (Optional, with httpx[cli])
  • brotli or brotlicffi - Decoding for "brotli" compressed responses. (Optional, with httpx[brotli])
  • async_generator - Backport support for contextlib.asynccontextmanager. (Only required for Python 3.6)

A huge amount of credit is due to requests for the API layout that much of this work follows, as well as to urllib3 for plenty of design inspiration around the lower-level networking details.

⭐️

HTTPX is BSD licensed code. Designed & built in Brighton, England.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].