Status codes · 1xx–5xx
5xx: 500, 502, 503, 504 and retry limits
Separate application, gateway and upstream failures.
Understand the concept
500 signals an unexpected server condition, without justifying disclosure of stack traces or secrets. 501 means required functionality is not implemented. 502 means a gateway received an invalid upstream response, while 504 means it did not receive one in time. Identify the responding hop before diagnosing an application crash.
503 can signal temporary overload or maintenance. Retry-After can be a delay or an HTTP date, but it does not make replay safe. A POST may already have committed even when its response never reached the gateway. Use application idempotency, atomic deduplication and result lookup where needed.
Specialised codes cover protocol versions, negotiation errors, storage and network access. 511 is associated with network authentication, not ordinary application login. Vendor-specific numbers are not automatically standard HTTP codes. Bound retries by attempts and elapsed time, and use backoff with jitter only when appropriate.
When diagnosing proxy logs and planning safe retries.
Assuming a POST that returned 504 was never processed.
One topic. Three levels of depth.
HTTP/1.1 500 Internal Server ErrorUse correlation with internal logs; do not expose a stack trace.
This page does not send requests to external servers. Messages are readable HTTP/1.1 illustrations, not HTTP/2 or HTTP/3 wire dumps. example.test is reserved for examples. Run commands and JavaScript only in your own test environment; never publish real tokens or cookies.
Try it yourself first.
A payment returned 504. Is repeating it with a new key safe?
Show the solution and explanation
Check existing operation; reuse the original idempotency contract.No. The first payment may have succeeded; a new key can bypass deduplication.