What are HTTP status codes?
Three-digit numbers at the start of every HTTP response that tell the client whether the request succeeded, was redirected or failed, and why. The first digit gives the class, from 1xx informational to 5xx server error.
What is the difference between 401 and 403?
401 Unauthorized means the request is not authenticated: credentials are missing, invalid or expired, and logging in may fix it. 403 Forbidden means the server knows who you are and still refuses; logging in again will not help.
What is the difference between 404 and 410?
404 Not Found says nothing is at the URL, without saying whether that is permanent. 410 Gone says the resource was removed deliberately and will not return. Google treats both the same way and removes the URL from its index.
Should I use 301 or 302?
301 for permanent moves, such as a new URL structure or domain, because it transfers ranking signals to the new URL. 302 for temporary ones, such as a short campaign or an A/B test, where the old URL should stay indexed.
What is the difference between 301 and 308, or 302 and 307?
307 and 308 require the client to repeat the same method and body, while 301 and 302 allow a POST to become a GET. For web pages 301 and 302 are fine; for APIs prefer 308 and 307.
When should an API return 422 instead of 400?
400 is for requests the server cannot parse or that are malformed. 422 Unprocessable Content fits requests that are well-formed but fail validation, such as an invalid email in valid JSON.
What is the difference between 500, 502, 503 and 504?
500 is a failure inside the application. 502 and 504 come from a proxy or gateway that got a bad response or no response in time from the server behind it. 503 means the service is temporarily overloaded or down for maintenance.
What does 304 Not Modified mean?
The client's cached copy is still current, so the server sends no body. It answers a conditional request that carried an If-None-Match or If-Modified-Since header.
What does 429 Too Many Requests mean?
The client has hit a rate limit. Wait for the time in the Retry-After header, or back off exponentially if there is none, before trying again.
What is a soft 404?
A page that tells visitors it does not exist but returns 200 OK. Search engines may still crawl and flag it; return a real 404 or 410 instead.
Which status code should a successful POST or DELETE return?
A POST that creates a resource should return 201 Created with a Location header. A DELETE that succeeds with nothing to return should use 204 No Content, or 200 if it returns a body.
Is 418 I'm a teapot a real status code?
It comes from a 1998 April Fools' RFC. RFC 9110 reserves 418 as unused so it is never assigned to anything real; avoid it in production APIs.