A next-generation HTTP client for Python
open sourceBSD-3-Clausefree
HTTPX is a fully featured HTTP client for Python 3 from Encode, with sync and async APIs and support for HTTP/1.1 and HTTP/2. Its API is broadly compatible with Requests, and it adds strict timeouts everywhere, full type annotations, and the ability to send requests directly to WSGI or ASGI applications. It has connection pooling, cookie-persisting sessions, proxies (HTTP, HTTPS and, optionally, SOCKS), streaming downloads, multipart uploads and automatic decompression, with optional brotli and zstandard decoders and an optional command-line client. It requires Python 3.9 or later and is BSD-3-Clause licensed.
Ways to install
Package managers
Problems it solves
- make async HTTP requests in Python with a Requests-like API
- an HTTP client for Python that supports HTTP/2
- test my ASGI app by calling it directly without running a server
Features
- sync and async APIs in one client
- HTTP/1.1 and optional HTTP/2
- a broadly Requests-compatible API
- strict timeouts everywhere and full type annotations
- send requests straight to WSGI or ASGI apps for testing
- optional command-line client with httpx[cli]
Alternatives
The same job
These do what HTTPX does.
