Reading HTTP Status Code Families

A status family provides a broad classification, while the specific response code conveys the outcome relevant to the request.

Source
Anbloq
Language
English
Created
Updated
Chapters
4
Reading time
1 min
In this article4 chapters
  1. Compare two ordinary cases
  2. Read the exact status
  3. Pair example codes with the next action a caller can take
  4. Check the body contract independently

Compare two ordinary cases

A 400 response can indicate a request problem and a 503 response can indicate temporary unavailability. A client may respond with correction for the first and a limited retry policy for the second under its contract. Temporary failures describe how those decisions differ.

Read the exact status

Grouping every 2xx result together may hide whether content is available or processing only began. Reading an HTTP response describes the role of specific codes and fields.[1]

Pair example codes with the next action a caller can take

A successful retrieval can return 200. A created resource can use 201. A missing resource can use 404. An unavailable service can return 503. The first digit gives a broad family, while the specific code and documented headers can matter for the caller. See reading an HTTP response.

200 → read successful representation under the contract
201 → creation success, inspect resource reference if supplied
404 → requested resource unavailable by that response
503 → service temporarily unavailable under ordinary semantics

Check the body contract independently

A response can carry structured details explaining failure. A success with an unexpected body still fails the business operation. Test a representative status from each family the endpoint advertises.

References

  1. IETF, RFC 9110: HTTP Semantics ↩