Why do we need all these numbers?

The three-digit numbers appearing on our monitors are server’s codes of responses to requests in accordance with the Hypertext Transfer Protocol (http). The http is one of the most widespread network protocols, i.e. certain rules for regulation of server connections and data exchange. This protocol provides for the well-coordinated work of various programs, operating systems and devices. In other words, thanks to http protocol users can use browsers, load web-pages, exchange emails and use other functions of the internet.

If to describe its work in simple words, it looks like this: using his or her computer, the user “sends” a request to the server, which is also a computer constantly connected to the network.  The server looks for requested information in databases of other servers. Having found it, the server sends the information to the user’s device. Data processing runs in accordance with the http protocol. The state of performing the request is defined with a three-digit code.

The Request for Content (RFC) file includes the list of the status codes. It contains standards and technical specifications used when one deals with the World Wide Web according to the http standard.  It was created in the middle of 1990s several years after the http protocol was created. The Internet Engineering Task Force (IETF), an international community for regulation software architectures, is responsible for creating new status codes.

Types of status codes

Usually they are divided into five groups – the first number of the code is the number of a group (from 1 to 5). The second and third numbers define the state of server responses. That is why codes are three-digit.

The first group aims to inform that everything goes well and the system works without errors. For instance, the code 100 means that a user has made a correct request and server started its processing. The code 101 is an inner code, which means that during the request processing another version of the http protocol is used. 102 means that the request is being processed a little bit longer than usual.

The second group of codes confirms that a request has been received. The 200 means that everything is OK – all requests have been processed, transferred and completed. The 203 resembles 200, but it is used when a request leads to the information from archives or backup databases. The code 204 means that a request has been processed, but there is no required information. To gain an access to such data, a user has to authenticate himself. The second group also includes the codes that require page reloading, additional cache settings and other codes. At the same time, 2XX codes are not connected with errors.

The third group is about redirection or extra user activities needed for receiving certain information. But sometimes users don’t have to follow additional links – the redirection can be automatic. For instance, the code 304 is used when access is allowed, but the page has not been modified since the user visited it last time. In this case, the server doesn’t receive the request, and the cached pages are loaded. The code 300 informs users that a website has changed its domain name, but instead of automatic redirection it offers to choose one of several websites that correlate with user’s interests.

When the status codes become visible…

In the cases mentioned above, users cannot see the status codes. However, if one wants to look at them, one can push F12 and then click the Network tab - the status code will be shown in the tool bar. Yet, the  three-digit codes become visible when something goes wrong with request processing.

The 4XX codes mean that a server cannot process a request because of a user’s mistake or a failure of one of the user’s systems. When one uses the browser, the text “400 Bad Request” can appear. This code is used only when the user makes rough mistakes when entering the address, and system cannot verify it. Sometimes a page has changed its domain name, but the redirection function is not used. Among other reasons for such errors are antivirus blockings, internet disconnections and others.

The most undesirable code is 404, but it helped choose the date for the Internet Day (the 4th of Aplri). This code means that server doesn’t manage to find the requested information. Why? So, files can be deleted or the user could have entered the wrong address. There’s also the blank page with  “Error 408 Request Timeout.” It means that a server hasn’t received the expected request. It may be caused by disconnections that prevent request from reaching the addressee, viruses or problems with a website. The code 413 or “Request entity too large” appears when a user enters too many words into the search box. But it is easy to avoid this error by shortening the phrase. All in all, the forth group includes 35 status codes.

The fifth group contains the errors of the server. There are ten status codes in it. One of the most widespread errors is “Bad Gateway” titled with 502.  Here, the server is a half-way point, but a request cannot get through to it and move forward.  It can be caused by mismatch of protocols or lack of server’s resources due to which the server has no enough capacity to process the requests. When your gateway is very bad, you can try deleting the cookie files.

Servers process requests one by one, that is why when a server gets requests that weight a lot, it becomes unresponsive. It provokes the error 503, which means that the service is unavailable. Those who are not programmers cannot solve this problem – the only thing one can do is wait.

“Almost all codes have numbers that may help a user find the reason of some error or disconnection. But I think that the 404 is the only well-known code – now it has become a meme. In fact, users don’t have to deal with these codes, but unfortunately, there are many lazy programmers who don’t want to make user-friendly error reports,” said Sergei Klimenkov, lab assistant of the Department of Computation Technologies