Skip to the content.

ADR-0001: HTTP Client Layer

Decision: urllib3.PoolManager as the sync base, httpx.AsyncClient for async.

Why urllib3 over requests:

Why httpx for async:

Retry configuration:

Retry(
    total=3,
    backoff_factor=0.5,
    status_forcelist={429, 500, 502, 503, 504},
    allowed_methods={"GET", "POST", "PUT", "PATCH", "DELETE"},
)

Note: allowed_methods (not method_whitelist) — urllib3 ≥ 2.0 API.

GNATClientError carries status and body: Always check exc.status in connector tests — 401 vs 403 vs 429 all need different handling.


Licensed under the Apache License, Version 2.0