skillfed

respx

A utility for mocking out the Python HTTPX and HTTP Core libraries.

respx Permissive license BSD-3-Clause Active 828 v0.23.1 released

Install

respx on PyPI

pip

pip install respx

uv

uv add respx

poetry

poetry add respx

Package 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

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.
mock httpx requestshttpx testing libraryhttp client mockingpytest httpx fixturestub http responsesasync http mockinghttpx request patterns

Similar packages