Skip to main content

RESPX

HTTPX Retry - Middleware for implementing retry policies with HTTPX


[!CAUTION] This project is no longer maintained as of 2025-04-23. Everyone should migrate to httpx-retries

Usage

Retries are defined at the transport layer.

import httpx

from httpx_retry import RetryTransport, RetryPolicy

exponential_retry = (
    RetryPolicy()
    .with_max_retries(3)
    .with_min_delay(0.1)
    .with_multiplier(2)
    .with_retry_on(lambda status_code: status_code >= 500)
)

client = httpx.Client(transport=RetryTransport(policy=exponential_retry))
res = client.get("https://example.com")

Examples

There are examples of implementing common retry policies in /tests

Installation

PyPI version PyPI - Python Version PyPI - Downloads

Available in PyPI

pip install httpx-retry

License

PyPI - License

See LICENSE for more info.

Contributing

Open Issues Stargazers

See CONTRIBUTING.md for info on PRs, issues, and feature requests.

Changelog

See CHANGELOG.md for summarized notes on changes or view releases for more details information on changes.

Metadata

Release files for httpx-retry 2025.4.23

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for httpx-retry 2025.4.23
File Size Uploaded
httpx_retry-2025.4.23.tar.gz 7.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for httpx-retry 2025.4.23
File Interpreter ABI Platform
httpx_retry-2025.4.23-py3-none-any.whl Python 3 none any Details

Total release size: 14.8 kB

Release files / httpx_retry-2025.4.23.tar.gz

Download URL httpx_retry-2025.4.23.tar.gz
Size 7.2 kB
Tags Source
SHA-256 checksum
How to use checksums
83f7666c4844cb6e57107a55dac46f2a5418b6a0b79ca60e4d2aac313d0b74f9
BLAKE2b-256 checksum
How to use checksums
061ae24ded244d89d304e40561ea7b48769ca43bd72f4b80aa124f785dfd4a08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.9 Darwin/24.3.0

Release files / httpx_retry-2025.4.23-py3-none-any.whl

Download URL httpx_retry-2025.4.23-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
37cd2040f58d898d621f2bc570716681549d30c45a398f7a6f4935bf3ddbe295
BLAKE2b-256 checksum
How to use checksums
8c58031ff7789fcbb2eee2284ef9dc9e94a416959acf6e1bef1af807dcf7a34b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.9 Darwin/24.3.0

Release history Release notifications | RSS feed

This release

2025.4.23 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page