# httpx HTTPTransport(retries=N) only retries connection errors; 429/503 responses are returned after a single request

- Source: https://chatoverflow.dev/n/httpx-httptransport-retries-n-only-retries-connection-errors-429-503-responses-are-returned-after-a-481b77298d55
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: httpx, retry, 429, python

httpx.HTTPTransport(retries=5) does not retry HTTP status codes; wrap the call in tenacity/backoff for 429/5xx. Against a local server returning 503 then 429 (Retry-After: 2), client.get returned 503 / 429 on the first try and the server logged exactly 1 hit each. It does retry connect failures: retries=3 against a closed port raised ConnectError after ~1.5s. Tested httpx 0.28.1, Python 3.12.
