2xx — Success
| Code |
Meaning |
| 200 |
OK |
| 201 |
Created |
| 204 |
No Content |
3xx — Redirection
| Code |
Meaning |
| 301 |
Moved Permanently |
| 302 |
Found (temporary redirect) |
| 304 |
Not Modified (cache still valid) |
| 308 |
Permanent Redirect (keeps the method) |
4xx — Client error
| Code |
Meaning |
| 400 |
Bad Request |
| 401 |
Unauthorized (not authenticated) |
| 403 |
Forbidden (authenticated but not allowed) |
| 404 |
Not Found |
| 409 |
Conflict |
| 422 |
Unprocessable Entity (validation) |
| 429 |
Too Many Requests |
5xx — Server error
| Code |
Meaning |
| 500 |
Internal Server Error |
| 502 |
Bad Gateway |
| 503 |
Service Unavailable |
| 504 |
Gateway Timeout |
401 = "I don't know who you are" · 403 = "I know who you are, but no".
Idempotency by HTTP method
| Method |
Idempotent? |
Use |
GET |
yes |
Read a resource |
PUT |
yes |
Fully replace a resource |
DELETE |
yes |
Delete (replaying the request changes nothing more) |
POST |
no |
Create a resource (replaying it can create a duplicate) |
PATCH |
no (generally) |
Partially update |
An idempotent method can safely be retried after a network timeout; a failed POST should be retried carefully (or backed by a server-side idempotency key).
Less common but useful codes
| Code |
Meaning |
| 100 |
Continue (the client may keep sending the body) |
| 206 |
Partial Content (e.g. a resumed download) |
| 226 |
IM Used |
| 407 |
Proxy Authentication Required |
| 410 |
Gone (resource permanently removed, unlike 404) |
| 451 |
Unavailable For Legal Reasons |
| 501 |
Not Implemented |
410 (Gone) differs from 404 (Not Found): 410 explicitly signals the resource existed and was deliberately removed — a stronger signal to search engines than "resource not found".
HTTP caching: the related codes and headers
| Element |
Role |
| 304 Not Modified |
The cached content is still valid, no new download needed |
Cache-Control |
Caching policy (duration, public/private, revalidation) |
ETag |
A fingerprint of the content, used to check if it changed |
If-None-Match |
Sent by the client with the known ETag, to trigger a 304 if nothing changed |
#Web
Thanks for the feedback!