HTTP status codes are used to indicate the result status returned by a web server when processing an HTTP request. HTTP status codes consist of 3 digits and are divided into 5 categories:
- 1xx (Informational status codes): The request has been accepted and is being processed.
- 2xx (Successful status codes): The request has been successfully received, understood, and accepted by the server.
- 3xx (Redirection status codes): Further action is needed from the client to complete the request.
- 4xx (Client error status codes): The request contains syntax errors or cannot be completed.
- 5xx (Server error status codes): An error occurred on the server while processing the request.
Common valid HTTP status codes include:
- 200 OK: The request has been successfully received, understood, and accepted by the server.
- 201 Created: The request has been fulfilled, and a new resource has been created based on the request.
- 204 No Content: The server successfully processed the request but does not need to return any entity content and wishes to return updated meta-information.
- 206 Partial Content: The server successfully processed part of the GET request.
- 301 Moved Permanently: The requested resource has been permanently moved to a new location.
- 302 Found: The requested resource has been temporarily moved to a new location.
- 304 Not Modified: The resource has not been modified and can use the cached version from the client.
- 400 Bad Request: The server cannot understand the format of the request, and the client should not attempt to send the same content again.
- 401 Unauthorized: The request requires authentication and has not been authorized.
- 403 Forbidden: The server understands the request from the client but refuses to execute it.
- 404 Not Found: The server cannot find the resource based on the client's request.
- 500 Internal Server Error: An internal server error occurred, and the request cannot be completed.