Skip to content
Tech News
← Back to articles

httpx2

read original more articles
Why This Matters

HTTPX2 represents a significant advancement in Python's HTTP client libraries by supporting both HTTP/1.1 and HTTP/2, offering synchronous and asynchronous APIs, and maintaining compatibility with the popular requests library. Its ongoing stewardship ensures a reliable, secure, and evolving tool for developers, addressing the needs of modern web communication and critical production systems.

Key Takeaways

HTTPX2

A next-generation HTTP client for Python.

HTTPX2 is a fully featured HTTP client library for Python. 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 HTTPX2 is a continuation of the wonderful work started by @lovelydinosaur and the broader HTTPX community. We're enormously grateful for everything that has gone into HTTPX over the years - it has been a foundational piece of the modern Python ecosystem, and this project would not exist without it. With HTTPX itself seeing limited activity recently, Pydantic is picking up stewardship under the HTTPX2 name so that users have a reliably maintained path forward - including timely security updates for a library that sits in the critical path of so many production systems. Our aim is to honour the original project's design, keep it stable for everyone relying on it, and continue evolving it carefully. Thank you to @lovelydinosaur and every past contributor for laying such a strong foundation. 💙

Install HTTPX2 using pip:

pip install httpx2

Now, let's get started:

>>> import httpx2 >>> r = httpx2.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>

<html>

<head>

... continue reading