COMPUTER ENGINEER

Jump to examples
Blog
HTTP / HTTPS / TLS6 min study
18/ 70

Status codes · 1xx–5xx

5xx: 500, 502, 503, 504 and retry limits

Separate application, gateway and upstream failures.

UnderstandStudy an examplePractise

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 TO USE IT

When diagnosing proxy logs and planning safe retries.

COMMON PITFALL

Assuming a POST that returned 504 was never processed.

01 / PRACTICE

One topic. Three levels of depth.

HTTP / illustrative example
HTTP/1.1 500 Internal Server Error

Use 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.

02 / YOUR TURN

Try it yourself first.

A payment returned 504. Is repeating it with a new key safe?

Show the solution and explanation
Worked solution
Check existing operation; reuse the original idempotency contract.

No. The first payment may have succeeded; a new key can bypass deduplication.