What the numbers mean.
WHAT THE RANGES MEAN
- One hundreds: informational
- Two hundreds: it worked
- Three hundreds: look elsewhere
- Four hundreds: the request was wrong
- Five hundreds: the server failed
WHY THE FOUR AND FIVE DISTINCTION MATTERS MOST
One means fix your request; the other means try again later.
WHAT THE COMMON SUCCESS CODES ARE
- Two hundred: success with a body
- Two hundred and one: something was created
- Two hundred and four: success with nothing to return
WHAT THE COMMON CLIENT ERRORS ARE
- Four hundred: the request was malformed
- Four hundred and one: not authenticated
- Four hundred and three: authenticated but not permitted
- Four hundred and four: not found
- Four hundred and nine: a conflict with current state
- Four hundred and twenty-two: valid format, invalid content
- Four hundred and twenty-nine: too many requests
WHAT THE DIFFERENCE BETWEEN UNAUTHENTICATED AND FORBIDDEN IS
Who you are, against what you may do.
WHY THAT DISTINCTION MATTERS
They require different responses from the caller.
WHAT THE COMMON SERVER ERRORS ARE
- Five hundred: something broke
- Five hundred and two: an upstream system failed
- Five hundred and three: temporarily unavailable
- Five hundred and four: an upstream system timed out
WHAT TO RETRY
Five hundreds, and four hundred and twenty-nine.
WHAT TO NEVER RETRY UNCHANGED
Four hundreds, generally.
WHY
The request itself is the problem.
WHAT TO NEVER DO
Return two hundred with an error inside the body.