Junior — Middle
Can you explain what is meant by status code in HTTP responses?
sobes.tech AI
Answer from AI
HTTP response status codes are numeric codes that the server sends to the client to indicate the result of processing a request. They help understand whether the request was successful or if an error occurred, and what kind of error.
Status codes are divided into five groups:
- 1xx (Informational): request received, processing continues.
- 2xx (Success): request successfully processed (e.g., 200 OK).
- 3xx (Redirection): further action needed from the client (e.g., 301 Moved Permanently).
- 4xx (Client error): error on the client side (e.g., 404 Not Found).
- 5xx (Server error): error on the server side (e.g., 500 Internal Server Error).
Example: if the server returns code 404, it means the requested resource was not found.