HTTP Status Messages
HTML Error Messages
In this article, we will focus on HTTP status messages. It is possible for web servers to return an error code such as “404 Not Found” when requesting services from browsers.
HTML error messages are commonly used to describe these errors. HTTP status messages are what these messages are called.
Every time a request is made, the server always returns a message. An example of a 200 OK message is shown below.
The following are possible list of http status codes or HTTP status messages:
1xx: Information
Message: | Overview |
---|---|
101 Switching Protocols | Protocol switching has been requested by the requester |
103 Early Hints | This is used in conjunction with the Link header to allow the browser to begin preloading resources while the server prepares a response |
100 Continue | Request headers have been received by the server, and the client should proceed to send the request body |
2xx: Successful (http response status code)
Message: | Overview |
---|---|
201 Created | There is a new resource created after the request has been fulfilled |
202 Accepted | There was no confirmation that the request would be processed, but it has been accepted for processing in HTTP status |
200 OK | There was no error (this is the standard response for HTTP requests that have been successful) |
203 Non-Authoritative Information | Successfully processed, but returning information from another source |
205 Reset Content | There is no content returned from the request, and the requester must reset the document view. |
206 Partial Content | Due to a range header sent by the client, the server is only delivering part of the resource |
204 No Content | There is no content returned after the request has been processed successfully |
3xx: Redirection
Message: | Overview |
---|---|
301 Moved Permanently | This page has moved to a new address as it comes to HTTP status |
300 Multiple Choices | A link list. Clicking on a link will take the user to that location. Five addresses are allowed |
303 See Other | A different URL can be used to access the requested page |
302 Found | There has been a temporary change of URL for the requested page |
308 Permanent Redirect | There has been a permanent change to the URL of the requested page |
307 Temporary Redirect | We have temporarily moved the requested page to a new address |
304 Not Modified | No changes have been made to the requested page since the last request |
4xx: Client Error
Message: | Overview |
---|---|
401 Unauthorized | However, the server isn’t responding to a legal request. The authentication process can be used when the authentication process has failed or not yet been completed. |
403 Forbidden | The server is refusing to respond to a legal request when it comes to HTTP status. |
400 Bad Request | A bad syntax error prevents the request from being fulfilled. |
406 Not Acceptable | Clients will only accept a response from the server if it is not accepted by them. |
404 Not Found | It is possible that the requested page will be available again in the future. |
402 Payment Required | To be used in the future. |
407 Proxy Authentication Required | Authenticating with the proxy is the first step for the client. |
405 Method Not Allowed | The page was requested using a request method it did not support. |
409 Conflict | A conflict in the request prevented the request from being completed. |
408 Request Timeout | Waiting for the request, the server timed out. |
410 Gone | It is no longer possible to access the requested page. |
411 Length Required | It is not defined what “Content-Length” should be. Without it, the server won’t accept the request. |
412 Precondition Failed | The server evaluated the precondition as false. |
413 Request Too Large | Due to the size of the request entity, the server will not accept the request. |
415 Unsupported Media Type | Due to an incompatible media type, the server will reject the request. |
416 Range Not Satisfiable | A portion of the file has been requested, but the server is unable to provide it. |
417 Expectation Failed | There is a problem with the server’s response-header, which does not meet the requirements. |
414 Request-URI Too Long | The URI is too long, so the server will not accept the request. When you convert a POST request into a GET request with a long query. |
5xx: Server Error
Message: | Overview |
---|---|
505 HTTP Version Not Supported | HTTP protocol version used in the request is not supported by the server |
500 Internal Server Error | Messages given when more specific messages are not appropriate |
502 Bad Gateway | An invalid response was received from the upstream server by the server acting as a gateway or proxy |
503 Service Unavailable | There is a problem with the server (it is overloaded or down) at the moment |
501 Not Implemented | Either the request method is unknown to the server, or the request cannot be fulfilled by the server in HTTP status |
511 Network Authentication Required | To access the network, the client must authenticate |
504 Gateway Timeout | Attempts were made to reach the upstream server, but the server did not respond in a timely manner |
HTTP Status Messages Advantages
Following are the advantages of HTTP Status Messages:
- Clear Communication: HTTP status messages provide clear communication between the client and server regarding the status of the requested resource.
- Efficient Error Handling: HTTP status messages allow for efficient error handling, enabling the client to take appropriate action in case of errors or issues with the request.
- Troubleshooting: HTTP status messages provide valuable information about the status of the request, making it easier to troubleshoot issues.
- Server Monitoring: HTTP status messages can be used for server monitoring, providing information on server performance and identifying potential issues.
- Security: HTTP status messages can be used for security purposes, such as indicating when access is denied due to authentication or authorization issues.