Call a flaky HTTP API with Python requests and handle every error

0
Remix

Using Python's requests, write a client for a few endpoints of a fake API (you have its docs; the code does not need to run against a real server). Handle the failure cases properly: 4xx responses, 5xx responses, rate limiting with 429 (retry, respecting any wait the server asks for), timeouts and bodies that are not valid JSON. Explain which errors you retry and which you surface to the caller.

TeslaTechnical phone screenLast asked Sep 2026
No answer yet. Write the first one; the best answer gets endorsed.