HTTP Response Status Code

Websites are made up of lots of intricate and complex parts that make up the website itself. However, with so many parts making up a single website, it is natural that there is an equal amount of errors a website can produce when a developer is working on it. Each scenario calls for a specific situation. This is where HTTP response status codes come in. HTTP stands for Hypertext Transfer Protocol which is a medium for languages such as HTML to communicate from a browser to the server itself. Thus, HTTP response status codes are essentially codes that correspond to the response that the browser receives when communicating with its respective server. Error codes range from 1.x.x up till 5.x.x and are categorized according to its first number. These error codes are specifically called error responses as they signify an issue between the communication of the website’s browser to its respective server hence, the term HTTP response status code.

The first set of status codes are called information responses. A lot of the code under 1.x.x is related to relaying information, continuing its process, and then relaying the information back. The first response is 100 Continue code which is used to communicate with the server that everything is okay. It will be efficient and ignore finished work and proceed with other requests while some are still running. When finished the server sends a response that said request that was skimmed over has been finished. The 101 Switching Protocol code is for signaling protocols looking to switch the client request which also contains the upgrade request header for the protocols. The 102 Processing code is used to indicate that the server was able to receive the request but there isn’t a response currently. The 103 Early Hints code is to indicate that the link header is preparing a response.

The second set of status codes are called successful responses. Status codes under 2.x.x are requests that are received, processed and accepted. The 200 OK code is that the request has gone through. However, the meaning of the success depends on four different types of requests. There is the GET method, Head method, POST method, and Trace method. The GET method tales and relays the contents of the message body. The head method is located in the message body as a header. The POST method is telling the result of the action being relayed in the form of a message body. The TRACE method is the request message that the server receives.

The third set of status codes are called redirection responses. The meaning of these set of status codes is that further action will be needed to complete the entire request. The 300 Multiple Choice code is a link list. The request is able to take up to a maximum of five possible responses. The user is able to choose the link. The 301 Moved Permanently code shows that the requested contents have been allocated to a new URL. The new url is also provided in the response. The 302 Found code is that the requested contents have been moved to a temporary new URL. The new URL is needed to view the contents when a future request is initiated. The 303 See Other code is that the contents being called can be found in another URL. This status code is sent by the server to redirect the user to the desired page they want to visit. The 304 Not Modified is a code to indicate that the page being requested has not been modified since the last request by the visitor. 305 Use Proxy code is when a response is broadcasted by the server so that the URL being requested is able to be accessed by the proxy that is stated in the location header. The 307 Temporary Redirect code is that the requested contents have been moved to a temporary new URL. It’s similar to 302 Found with the only difference being that the user does not change the HTTP method used.

The fourth set of status codes are called client error responses. The meaning of these set of status codes is that there is bad syntax or that the syntax can’t be fulfilled. The 400 Bad Request code is when the server is unable to process the request as an invalid syntax is being used. 401 Unauthorized code is when the server doesn’t respond to the request because it lacks the permission to authenticate the contents. 402 Payment Required is reserved for now. It is meant to be used in conjunction with a digital payment system. 403 Forbidden code is the code that occurs when the user tries to access a certain site but doesn’t the rights to access it. 404 Not Found code is when the server is unable to find the contents requested by the user. 404 can be displayed instead of 403 to hide the contents from an unauthorized user. 405 Method Not Allowed code is when the server knows the method being requested but it’s currently disabled by the server. 406 Not Acceptable is when the server does not find the contents specified by the user. 407 Proxy Authentication Required is when the user authenticates itself with the server’s proxy. 408 Request Timeout code is when the server is unable to receive the required response in time.

The fifth set of status codes are called server error responses. The meaning of these set of status codes is that the server failed to execute a valid request. 500 Internal Server Error code is an error message that happens when the server is greeted with an unexpected situation and is unsure how to solve it. 501 Not Implemented code is when the server either hasn’t had the request yet or is unable to fulfil the request due to being short on capacity. 502 Bad Gateway code is when the server is seen as a gateway and it is given an invalid response by the upstream server.

In conclusion, there are a variety of status codes that represent different situations. Each code are categorised according to the first number of the status code. There are a total of 5 categories that make up the response status codes. These have been very helpful for developers when they were using it to learn how to debug their websites.

Raphael Reynaldi - 2440071973