respx
A utility for mocking out the Python HTTPX and HTTP Core libraries.
Install
respx on PyPI
pip
pip install respxuv
uv add respxpoetry
poetry add respxPackage facts
| License | BSD-3-Clause (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — httpx |
| Maintenance | actively maintained — 127 days since the last release |
| Last repo commit | |
| First released | |
| Popularity | one of the top 1,000 most-downloaded packages on PyPI (30-day window, as of 2026-08-13) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-13) |
Evidence: respx-0.23.1-py2.py3-none-any.whl
Keywords: httpx, httpcore, mock, responses, requests, async, http
About respx
from the package's own PyPI description — quoted content, verbatim
<p align="center"> <a href="https://lundberg.github.io/respx/"><img width="350" height="208" src="https://raw.githubusercontent.com/lundberg/respx/master/docs/img/respx.png" alt='RESPX'></a> </p> <p align="center"> <strong>RESPX</strong> <em>- Mock HTTPX with awesome request patterns and response side effects.</em> </p>
tests (image) codecov (image) PyPi Version (image) PyPI Downloads (image) Python Versions (image)
Documentation
Full documentation is...
Read as markdown · JSON record · Source repository · Homepage
AI interpretation — verify before relying
AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page
respx mocks the httpx HTTP client library for testing, letting you define request patterns and stub responses without hitting real servers.
Low friction: pure Python wheel, single runtime dependency (httpx), and actively maintained with recent commits. Supports Python 3.8–3.14.
BSD-3-Clause is permissive; you may use, modify, and redistribute respx freely in commercial and private projects with minimal restrictions.
Usage
pip install respx
import httpx
import respx
from httpx import Response
@respx.mock
def test_api():
respx.get("https://example.org/").mock(return_value=Response(204))
response = httpx.get("https://example.org/")
assert response.status_code == 204
Requires Python 3.8+ and httpx 0.25+.
Verdict: respx is a stable, well-maintained mocking utility for httpx with no known vulnerabilities, permissive licensing, and low install friction. It is suitable for test suites that need to stub HTTP interactions without external dependencies.
Needs verification
- Whether respx supports mocking HTTP Core directly or only via httpx integration.
- Performance characteristics when mocking large numbers of routes or high-volume request patterns.
Similar packages
permissive · top 1,000 on PyPI
time-machinepermissive · top 1,000 on PyPI
vcrpypermissive · top 1,000 on PyPI
requests-mockpermissive · top 1,000 on PyPI
httpxpermissive · top 100 on PyPI
responsespermissive · top 1,000 on PyPI
pbs-installerpermissive · top 1,000 on PyPI
pytest-httpxpermissive · top 1,000 on PyPI
motopermissive · top 1,000 on PyPI
httpx-ssepermissive · top 1,000 on PyPI