HTTPX

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

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

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
56 /100 Fair
Development Activity 4
Maintenance 44
Community 76
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
87 /100 Excellent
Architecture 85
Code Quality 88
Innovation 84
Learning Curve 90

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 86 apps in this directory

JavaScript
40%
MIT

NoteDiscovery

Knowledge Management · Note Taking · Productivity

2,813

A self-hosted markdown knowledge base with MCP-powered AI integration, graph views, LaTeX math, and built-in drawing — your notes stay on your server, forever.

View details
80
Repo Health
59
Technical
74
Dependency
Built with
JavaScript 40%
Python 32%
HTML 24%
Updated 1 weeks ago
TypeScript
59%
MIT

oh-my-claudecode

AI Agents

39,383

Multi-agent orchestration for Claude Code with zero learning curve — install as a plugin or npm CLI and coordinate parallel Claude Code agents through pre-built workflows instead of managing them by hand.

View details
85
Repo Health
70
Technical
76
Dependency
Built with
TypeScript 59%
JavaScript 40%
Updated 1 weeks ago
TypeScript
58%
MIT

open-notebook

AI Assistants · Note Taking

39,569

A privacy-first, self-hosted AI research notebook with 18+ model providers, multi-speaker podcast generation, and full REST API—your open-source alternative to Google Notebook LM.

View details
90
Repo Health
84
Technical
71
Dependency
Built with
TypeScript 58%
Python 39%
Updated 1 weeks ago
Python
37%
Other

Open WebUI

AI Agents · AI Assistants

153,390

The extensible, privacy-first AI platform that runs Ollama, OpenAI, and any LLM backend behind a polished, feature-packed web interface.

View details
91
Repo Health
75
Technical
66
Dependency
Built with
Python 37%
Svelte 34%
JavaScript 21%
Updated 1 weeks ago
TypeScript
95%
Other

OpenHands

AI Code Assistants · AI Development

89,328

The self-hosted developer control center for running AI coding agents — locally, in Docker, on VMs, or across cloud backends — with automation workflows for GitHub, Slack, and more.

View details
91
Repo Health
82
Technical
67
Dependency
Built with
TypeScript 95%
Updated 1 weeks ago
Python
74%
Apache 2.0

OpenKB

Knowledge Management

4,579

An open-source CLI that compiles raw documents into a structured, interlinked wiki-style knowledge base using LLMs — powered by vectorless, reasoning-based retrieval (PageIndex) instead of a vector database.

View details
68
Repo Health
72
Technical
77
Dependency
Built with
Python 74%
TypeScript 23%
Updated 2 months ago
Python
100%
MIT

opennews-mcp

AI Agents · Developer Tools · Mcp

2,379

An MCP server that plugs AI agents into 85+ real-time crypto and finance news feeds, complete with AI impact scores, trading signals, and live WebSocket updates.

View details
52
Repo Health
62
Technical
75
Dependency
Built with
Python 100%
Updated 3 weeks ago
TypeScript
55%
Other

OpenReplay

Analytics

12,911

Self-hosted session replay and product analytics suite that lets you see exactly what users do on your web app — without sending data to third parties.

View details
90
Repo Health
77
Technical
66
Dependency
Built with
TypeScript 55%
Go 13%
Updated 2 weeks ago
Python
38%
Apache 2.0

OpenSandbox

Developer Tools · Security

15,540

Secure, fast, and extensible sandbox runtime for AI agents with multi-language SDKs and Docker/Kubernetes runtimes.

View details
85
Repo Health
81
Technical
72
Dependency
Built with
Python 38%
Go 35%
Updated 1 weeks ago

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