whatisgithub

What is httpx2?

pydantic/httpx2 — explained in plain English

Analysis updated 2026-05-18

176PythonAudience · developerComplexity · 2/5LicenseSetup · easy

In one sentence

A Python library for making HTTP requests, the Pydantic-maintained continuation of the popular HTTPX library, supporting sync, async, and HTTP/2.

Mindmap

mindmap
  root((HTTPX2))
    What it does
      HTTP Client Library
      Requests Style API
      Pydantic Maintained
    Features
      Sync and Async
      HTTP1.1 and HTTP2
      CLI Tool
      Streaming Downloads
    Extras
      Proxy Support
      Cookie Handling
      File Uploads
    Requirements
      Python 3.10 Plus
      Pip Installable

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Make HTTP requests to APIs from Python code using a syntax similar to the requests library.

USE CASE 2

Send many requests concurrently using async support instead of blocking one at a time.

USE CASE 3

Make HTTP requests directly from the terminal using the built in command-line tool.

USE CASE 4

Stream large file downloads or uploads with automatic timeout and decompression handling.

What is it built with?

PythonHTTP/2asyncio

How does it compare?

pydantic/httpx2opennswm-lab/faross0912758806p/agentic-sop-to-work
Stars176174173
LanguagePythonPythonPython
Setup difficultyeasyhardeasy
Complexity2/54/53/5
Audiencedeveloperresearcherops devops

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min
Use freely for any purpose, including commercial use, as long as you keep the copyright notice (BSD license).

So what is it?

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.

Copy-paste prompts

Prompt 1
Show me how to make both a synchronous and an asynchronous GET request to an API using httpx2.
Prompt 2
How do I configure a strict connection timeout and proxy support when making requests with httpx2?
Prompt 3
Explain the difference between HTTP/1.1 and HTTP/2 and how to enable HTTP/2 support in httpx2.
Prompt 4
Write an example that uses httpx2's command-line tool to send a POST request with a JSON body.
Prompt 5
How do I stream a large file download using httpx2 without loading it all into memory?

Frequently asked questions

What is httpx2?

A Python library for making HTTP requests, the Pydantic-maintained continuation of the popular HTTPX library, supporting sync, async, and HTTP/2.

What language is httpx2 written in?

Mainly Python. The stack also includes Python, HTTP/2, asyncio.

What license does httpx2 use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice (BSD license).

How hard is httpx2 to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is httpx2 for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.