What is an HTTP status code?

Started by Copeland, Apr 25, 2024, 02:55 PM

Previous topic - Next topic

Copeland


Larso


An HTTP status code is a three-digit numeric code returned by a web server in response to an HTTP request made by a client, typically a web browser. These status codes provide information about the outcome of the request and indicate whether it was successful, encountered an error, or requires further action.

There are five categories of HTTP status codes, each represented by a specific range of numeric values:

1xx Informational: These status codes indicate that the server has received the request and is continuing with the process. Examples include 100 Continue, which indicates that the client should continue with its request, and 101 Switching Protocols, which indicates that the server is switching protocols as requested by the client.
2xx Success: These status codes indicate that the request was successfully received, understood, and processed by the server. Examples include 200 OK, which indicates that the request was successful, and 204 No Content, which indicates that the server successfully processed the request but there is no content to return.
3xx Redirection: These status codes indicate that further action is required by the client to complete the request. Examples include 301 Moved Permanently, which indicates that the requested resource has been permanently moved to a new location, and 302 Found, which indicates that the requested resource has been temporarily moved to a different location.
4xx Client Error: These status codes indicate that the client has made a request that cannot be fulfilled due to an error on the client's part. Examples include 400 Bad Request, which indicates that the request could not be understood by the server due to malformed syntax, and 404 Not Found, which indicates that the requested resource could not be found on the server.
5xx Server Error: These status codes indicate that the server encountered an error while processing the request. Examples include 500 Internal Server Error, which indicates a generic server error, and 503 Service Unavailable, which indicates that the server is temporarily unable to handle the request due to overload or maintenance.
HTTP status codes provide valuable information about the status of HTTP requests and help troubleshoot issues encountered during web browsing or development. They are an essential part of the HTTP protocol and play a crucial role in communication between clients and servers on the web.

Didn't find what you were looking for? Search Below