HTTPX

A next-generation HTTP client for Python with sync, async, and HTTP/2 support

Library
PyPI
v0.28.1
15,429stars
BSD 3-Clause License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
55/100Fair
Development Activity8
Maintenance44
Community68
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
87/100Excellent
Architecture85
Code Quality88
Innovation84
Learning Curve90

HTTPX is a fully featured HTTP client for Python 3 that provides a broadly requests-compatible API while adding first-class support for both synchronous and asynchronous programming models. It supports HTTP/1.1 and HTTP/2 out of the box, ships an optional command-line client, and can dispatch requests directly to WSGI or ASGI applications for in-process testing.

Built by the Encode organization (also behind Starlette and Uvicorn), HTTPX layers a friendly, typed API on top of the lower-level httpcore transport library, giving developers connection pooling, streaming responses, proxy support, and strict timeout handling without sacrificing the ergonomics that made requests popular.

What You Get

  • A Client/AsyncClient pair with identical APIs for sync and async code, plus module-level httpx.get()/httpx.post() shortcuts
  • Native HTTP/2 support (opt-in via the http2 extra) alongside HTTP/1.1
  • Direct-to-app transports (WSGITransport, ASGITransport) for testing web apps without a running server
  • Connection pooling, streaming request/response bodies, and multipart file uploads
  • A pluggable httpcore-based transport layer with a MockTransport for unit-testing HTTP calls
  • An optional CLI (httpx[cli]) for making requests from the terminal with syntax-highlighted output

Common Use Cases

  • Calling external REST APIs from a Python backend service, sync or async
  • Writing integration tests for FastAPI/Starlette apps via ASGITransport without binding a real port
  • Streaming large file downloads or uploads with bounded memory usage
  • Migrating an existing requests-based codebase to async with minimal API changes
  • Building HTTP/2-aware clients that need multiplexed connections to modern APIs

Under The Hood

Architecture — HTTPX separates concerns cleanly across a few layers: _client.py (2,019 lines) defines a BaseClient holding shared state (auth, headers, cookies, timeouts, redirect policy) that both the synchronous Client and asynchronous AsyncClient subclass; _api.py exposes stateless module-level functions (get, post, request, stream, etc.) that construct a short-lived Client under the hood for one-off calls; _models.py (1,277 lines) implements Request/Response/Headers/URL value objects; and the _transports/ package (default.py, asgi.py, wsgi.py, mock.py, base.py) implements the actual wire-level dispatch, delegating real network I/O to the httpcore library while ASGITransport/WSGITransport bypass the network entirely to call an application object in-process — this is what makes HTTPX popular for testing async web frameworks.

Tech Stack — Pure Python 3.9+, built with hatchling/hatch-fancy-pypi-readme. Core runtime dependencies are minimal and deliberate: httpcore==1.* (transport), certifi (CA bundle), idna (IDN support), and anyio (async concurrency abstraction, enabling both asyncio and Trio backends). Optional extras (h2 for HTTP/2, socksio for SOCKS proxies, click/rich/pygments for the CLI, brotli/zstandard for extra content-encoding support) keep the base install lean while allowing opt-in capability.

Code Quality — The project advertises and maintains 100% test coverage (tool.coverage.run config enforces this), with 37 test modules under tests/ covering client behavior, transports, models, and edge cases like redirects and multipart encoding. Strict mypy mode is enabled project-wide (tool.mypy: strict = true), and ruff lint rules (E, F, I, B, PIE) are enforced. Internal modules use a leading-underscore convention (_client.py, _models.py) to clearly separate public API surface (re-exported via __init__.py) from implementation detail.

API Design — HTTPX deliberately mirrors the requests API (httpx.get(url), response .json()/.text/.status_code) so migration is close to a drop-in replacement, while extending it with async def equivalents on AsyncClient using the identical method names and signatures. Context-manager usage (with httpx.Client() as client: / async with httpx.AsyncClient() as client:) is the documented idiom for connection reuse, and the library is fully type-annotated, giving strong editor autocomplete and static-analysis support out of the box.

Used by 76 apps in this directory

Python
66%
Apache 2.0

Agent Control

AI Agents

295

An open-source runtime control plane for AI agents — define safety guardrails once, apply them across agents built on LangChain, CrewAI, Google ADK, or AWS Strands, and update controls without redeploying code.

View details
79
Repo Health
71
Technical
70
Dependency
Built with
Python66%
TypeScript33%
Updated yesterday
TypeScript
59%
Other

agenta

Developer Tools · Devops · AI Development

4,489

The open-source LLMOps platform unifying prompt engineering, evaluation, and observability for teams building reliable LLM applications.

View details
91
Repo Health
77
Technical
67
Dependency
Built with
TypeScript59%
Python39%
Updated today
Python
100%
Apache 2.0

Agno

Devops · AI Development · Automation

41,774

Build, run, and manage agent platforms with a full production stack — SDK, runtime, and control plane included.

View details
93
Repo Health
87
Technical
67
Dependency
Built with
Python100%
Updated today
Python
49%
Other

Airbyte

Developer Tools · Data Engineering

21,916

Open-source ELT platform with 600+ connectors for moving data from any source to warehouses, lakes, and AI agents.

View details
95
Repo Health
80
Technical
67
Dependency
Built with
Python49%
Kotlin42%
Updated today
Python
90%
Apache 2.0

Apache Airflow

Data Engineering

46,530

Define, schedule, and monitor complex data workflows as Python code — with a powerful UI, 80+ provider integrations, and battle-tested scalability across thousands of production deployments.

View details
96
Repo Health
89
Technical
66
Dependency
Built with
Python90%
Updated today
Python
59%
Apache 2.0

argilla

AI Development · Data Engineering

5,081

Collaborate on high-quality AI training data with a self-hosted annotation platform built for LLMs, NLP, and multimodal models.

View details
65
Repo Health
81
Technical
63
Dependency
Built with
Python59%
Jupyter Notebook21%
Updated 2 days ago
Python
97%
MIT

auto-news

AI Assistants · Productivity

906

An AI-powered personal news aggregator that filters multi-source feeds through LLMs and delivers curated, noise-free summaries to your Notion workspace.

View details
43
Repo Health
53
Technical
66
Dependency
Built with
Python97%
Updated 1 years ago
Python
62%
MIT

AutoGen

AI Development · Automation

60,518

Build autonomous and human-in-the-loop multi-agent AI systems with a layered, event-driven Python and .NET framework pioneered at Microsoft Research.

View details
57
Repo Health
78
Technical
75
Dependency
Built with
Python62%
C#25%
TypeScript12%
Updated 4 months ago
Python
68%
Other

AutoGPT

Automation · Productivity · AI Assistants

186,687

Build, deploy, and run autonomous AI agents that automate complex multi-step workflows using a visual block-based graph editor.

View details
93
Repo Health
78
Technical
67
Dependency
Built with
Python68%
TypeScript31%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search