STATUS CODES
In the internet world, HTTP (Hypertext Transfer Protocol) is used to ensure communication between web browsers and servers. In order to ensure that this communication occurs smoothly, HTTP status codes come into play. These codes are three-digit numeric codes that indicate the status of the server’s response to an HTTP request. Status codes help the client (browser or other HTTP client) understand whether the request it made was successful, redirected, or encountered an error. HTTP status codes fall into five main categories:
1xx — Informative Answers
1xx codes indicate that the client’s request has been received and the server continues processing. This category is rarely visible to the user and usually occurs in the background.
- 100 Continue: Indicates that the client’s request has been received and can continue.
- 101 Switching Protocols: Indicates that the server accepts the client’s protocol switching request.
2xx — Successful Responses
2xx codes indicate that the client’s request has been successfully received, understood and accepted.
- 200 OK: The request was successful and the server returned the requested resource.
- 201 Created: The request was successful and a new resource was created.
- 204 No Content: The request was successful, but the server could not find any content to return.
3xx — Redirects
3xx codes indicate that the client must contact another resource to complete its request. This is usually related to a routing process.
- 301 Moved Permanently: The requested resource has been moved permanently to another URL.
- 302 Found: The requested resource is temporarily located at another URL.
- 304 Not Modified: The source has not been modified; The client can use the version in its cache.
4xx — Client Errors
4xx codes indicate that there was an error in the client’s request. These errors indicate that the client’s request is not valid or is incorrect.
- 400 Bad Request: The request could not be understood by the server or was configured incorrectly.
- 401 Unauthorized: The request requires authentication and the client cannot be authenticated.
- 403 Forbidden: The client is not authorized to access the requested resource.
- 404 Not Found: The requested resource was not found on the server.
Get samet akıllı’s stories in your inbox
Join Medium for free to get updates from this writer.
5xx — Server Errors
5xx codes are errors given if the server cannot fulfill the request. These errors indicate a problem on the server side.
- 500 Internal Server Error: An unexpected error occurred on the server and could not fulfill the request.
- 502 Bad Gateway: The server received an invalid response from another server.
- 503 Service Unavailable: The server is currently unavailable (due to overload or maintenance).
The most familiar and commonly encountered HTTP status codes are:
- 200 OK: The request was successful and the server returned the requested resource.
- 301 Moved Permanently: The requested resource has been moved permanently to another URL. Redirection is done with the new URL.
- 302 Found: The requested resource is temporarily located at another URL. The client should try again with the new URL.
- 400 Bad Request: The request could not be understood by the server or was configured incorrectly.
- 401 Unauthorized: The request requires authentication and the client cannot be authenticated.
- 403 Forbidden: The client is not authorized to access the requested resource.
- 404 Not Found: The requested resource was not found on the server.
- 500 Internal Server Error: An unexpected error occurred on the server and could not fulfill the request.
- 502 Bad Gateway: The server received an invalid response from another server.
- 503 Service Unavailable: The server is currently unavailable (due to overload or maintenance).
These status codes are frequently encountered during web development and debugging, and knowing the meaning of these codes helps solve problems faster.
At the end of the day, HTTP status codes play a critical role in the backend of the web world. These codes allow browsers and servers to understand how they communicate with each other and the result of that communication. Thanks to these codes, developers can check whether web applications are working correctly and quickly identify any problems encountered. Thanks to these codes, users can understand the reasons for the errors they encounter and look for solutions when necessary. Proper understanding and use of HTTP status codes is essential to ensure the web experience is smooth and user-friendly.










