gitmyhub

httpx2

Python β˜… 608 updated 8d ago

A next generation HTTP client for Python. πŸ¦‹

HTTPX2 is a Python library for making HTTP requests β€” the kind of network calls your code makes when it needs to talk to a web server or API. It is a continuation of the widely used HTTPX library, picked up and maintained by the Pydantic organization after the original project slowed down. The name change to HTTPX2 signals this new stewardship rather than a major redesign.

The library is designed to feel familiar to developers who have used the popular requests library, while adding modern capabilities: support for both HTTP/1.1 and the newer HTTP/2 protocol (which allows more efficient connections), and both synchronous (one-step-at-a-time) and asynchronous (non-blocking, handles many requests at once) programming styles.

Other included features are a built-in command-line tool so you can make HTTP requests directly from your terminal without writing any Python, strict connection timeouts to prevent code from hanging indefinitely, streaming downloads for large files, proxy support, automatic response decompression, file uploads, and cookie handling.

The library requires Python 3.10 or newer and is installable via pip. HTTP/2 support, SOCKS proxy support, and command-line interface features are optional extras installed separately. Full documentation is available at httpx2.pydantic.dev.