CodeVetter
← All unpacks
CodeVetter · Repo Unpack evidence

encode/httpx

Scanned commit b5addb64f0 dated 2026-02-23 — last upstream commit. Generated by codevetter 1.15.0 on 2026-10-02.

github.com/encode/httpx ↗ · 113 files · 968 KB

HTTPX - A next-generation HTTP client for Python.

Deep analysis by cli:codex via the codex CLI on 2026-10-02 (382s) — every claim below links to its cited source files. Source inspection; upstream code and tests were not executed.

Overview

HTTPX is a Python HTTP client for application developers, with synchronous and asynchronous APIs plus an optional terminal client. It combines reusable connection pools, authentication, redirects, cookies, uploads, and response decoding behind a transport interface that can also call WSGI and ASGI applications directly. This brief reflects source inspection at commit b5addb64f0161ff6bfe94c124ef76f6a1fba5254; tests and CI were inspected, not executed.

System map

The package separates public APIs, client policy, HTTP models, and transport execution. Client configuration and cookies live in Python objects, while network connection pools belong to httpcore. Packaging produces a Python distribution and a MkDocs documentation site. The inspected workflows define verification and publication, but their outcomes were not observed.

Feature catalog

The user-facing surface consists of library APIs and a single HTTP request CLI. Library callers can choose convenience helpers or reusable clients, customize request construction, and consume buffered or streaming responses. Protocol, proxy, authentication, and in-process application integrations share the client model. The following eight groups describe capabilities supported by the inspected implementation.

Data flow

Request construction turns caller inputs into normalized URL, header, cookie, extension, and stream objects. Authentication and redirect loops can produce additional exchanges before the final response reaches the caller. Transports preserve raw protocol data and delegate network execution, while response models decode and optionally buffer bodies. State persists through the client cookie jar and connection pools; CLI downloads explicitly write decoded content.

Behavior traces

These traces follow implementation call order rather than executing scenarios. They cover client startup, an ordinary network request, redirects, authentication retries, cookie persistence, asynchronous application dispatch, and CLI downloads. Cleanup paths determine when connections are released and elapsed time becomes available. Each trace retains material branches such as disabled redirects, streaming mode, and application exceptions.

Testing signals

Tests and CI were inspected, not executed; test existence and configured thresholds are not passing results. The suite uses pytest, AnyIO-marked async tests, mock transports, and local Uvicorn servers. Inspected cases exercise important policy, streaming, CLI, and timeout behavior. Coverage exclusions and filtered conformance fixtures limit what the advertised coverage goal establishes, and this investigation is bounded rather than exhaustive.

Risk map

The following are source observations and one explicitly labeled resource-risk hypothesis, not confirmed vulnerabilities. Sensitive boundaries include outbound routing, certificate trust, credentials, redirects, stream ownership, and filesystem downloads. Several restrictions are intentional compatibility or API limits with corresponding tests. Documentation drift and excluded branches also matter when an agent assesses behavior.

Extension points

Extension is primarily explicit object injection rather than automatic plugin discovery. Transports replace execution, mounts route execution, and Auth generators implement multi-exchange credential behavior. Hooks and extensions add observation and transport-specific metadata without changing the simplified Request/Response model. Internal decoder registries and the CLI option table provide additional edit locations, with public exports checked separately.

Contributor handoff

Tests and CI were inspected, not executed, and this brief is a bounded source investigation rather than an exhaustive audit. Start at the public entrypoint and follow the specific policy, model, and transport boundary involved in the task. Preserve synchronous/asynchronous parity, stream ownership, request-merging rules, and explicit disabling semantics. Verification commands below describe the repository workflow for a separately authorized execution task; publication is a distinct external action.

Languages

LanguageFilesShare of source
Python6098%
Markdown29docs/config
YAML6docs/config
CSS1docs/config
HTML1docs/config
JSON1docs/config
TOML12%

Start reading here

Probable source entrypoint: pyproject.toml — inferred from the directory tree and manifest, not the upstream docs.

Source roots

httpx/ (24 files)

Source layout — httpx/

PathFiles
httpx/_transports/6
httpx/__init__.py1
httpx/__version__.py1
httpx/_api.py1
httpx/_auth.py1
httpx/_client.py1
httpx/_config.py1
httpx/_content.py1
httpx/_decoders.py1
httpx/_exceptions.py1
httpx/_main.py1
httpx/_models.py1
httpx/_multipart.py1
httpx/_status_codes.py1

Repository structure

Top-level pathFiles
tests/40
docs/26
httpx/24
.github/8
scripts/8

Docs found: LICENSE.mdREADME.mddocs/advanced/authentication.mddocs/advanced/clients.mddocs/advanced/event-hooks.mddocs/advanced/extensions.mddocs/advanced/proxies.mddocs/advanced/resource-limits.mddocs/advanced/ssl.mddocs/advanced/text-encodings.md

Package

pyproject.toml — httpx, 18 declared dependencies.

brotlibrotli;brotlicffi;]cliclick==8.*"pygments==2.*"rich>=10,<15"]http2h2>=3,<5"]

CI & config entrypoints

Structural health signals

Average score 7.1/10 across 23 analyzed source files; 6 hotspots surfaced.

These are deterministic review leads — size, churn, and structural signals — not proof of a bug in this project.

Recent history