How can a client tell whether an HTTP response is successful?
Quick answer
Check the exact status code, not just whether the client received a response. HTTP codes are grouped into classes: 2xx indicates success, 3xx redirection, 4xx client error, and 5xx server error; 1xx is informational. But the specific code matters: 202 Accepted means the request was received but has not yet been acted upon. Record the code and the result it confirms, and verify completion separately when needed. [S1]
The question, the details, the next step.
A practical checklist
Record the exact status code, not only its class.
Use the class as a broad category and check the individual code’s meaning.
State what the response confirms in plain language.
Mark completion as unconfirmed if the response does not establish it.
Note any separate check needed to confirm the operation’s outcome.
A few more useful answers
Does a 2xx status always prove the operation is complete?
No. The 2xx class is described as successful, but 202 Accepted specifically means the request was received and has not yet been acted upon. Interpret the individual code before claiming completion. [S1]
What should I do if I only have the status-code class?
Report the class as a broad classification and avoid claiming a more specific result. Get the exact code before describing what the response means.
Does this guide define the outcome for every HTTP code?
No. The cited information describes the five classes and gives 202 as an example; it does not establish the meaning of every code or the later behavior of a particular application. [S1]
Sources
References used for this guide.
- [S1] HTTP response status codes — MDN developer.mozilla.org · Checked
