HTTP Status Code
An HTTP status code is a three-digit number in a response. It tells the standard result of the request and which result group it belongs to.
Another example
An import API returns 202 and a status URL while work continues. It returns 201 with `Location` after an immediate creation. It returns 409 for a version conflict and 422 for CSV fields with invalid meaning. A JSON problem body adds useful details without changing what the code means.
Main parts
- 01Status class
- 02Registered code
- 03Response metadata and body
Use it when
Return the most exact registered code that fits the result. Add useful headers and a stable error body when needed.
Do not use it when
Do not return 200 for every business failure. Also avoid errors so specific that they reveal secret authorization details.
Name used in code
1xx informational, 2xx success, 3xx redirection, 4xx client, 5xx server Before you ship
Check contracts and invariants, authorization, and input limits. Test retries, one-time effects, timeouts, and partial failures. Verify data integrity, compatibility, monitoring, recovery, and rollback.
Outcome: Design or review HTTP Status Code for this system while keeping data correct, secure, and easy to operate. User context: An import API returns 202 and a status URL while work continues. It returns 201 with `Location` after an immediate creation. It returns 409 for a version conflict and 422 for CSV fields with invalid meaning. A JSON problem body adds useful details without changing what the code means. Technical concept or control: HTTP Status Code. Why it fits: Return the most exact registered code that fits the result. Add useful headers and a stable error body when needed. Do not use it when: Do not return 200 for every business failure. Also avoid errors so specific that they reveal secret authorization details. Engineering requirements: Define inputs, outputs, contracts, and rules that must always hold. Set authorization and input checks. Define failures, timeouts, retries, one-time effects, data moves, and compatibility limits. Operations: Add useful signals and logs that hide sensitive data. Set capacity limits and write an operator guide. Test recovery and rollback. Acceptance criteria: Contract and failure-path tests pass. Data and authorization rules still hold during retries and partial failures. Check performance limits, monitoring, recovery, and rollback. Evidence and limits (evidence boundary): The standard covers only the listed scope. It does not choose the visual style, product decision, or Vibulary example. Unknowns to confirm: Where the code runs, data stores, traffic shape, consistency needs, and the security boundary. Also confirm the compatibility period, service goals, and rollback limits.
Check this request
Review the current use of HTTP Status Code. Definition: An HTTP status code is a three-digit number in a response. It tells the standard result of the request and which result group it belongs to. Release checks: Check contracts and invariants, authorization, and input limits. Test retries, one-time effects, timeouts, and partial failures. Verify data integrity, compatibility, monitoring, recovery, and rollback. Before changing code, report the evidence you found, gaps, severity, and the smallest safe fix.