As we know, a client-server architecture allows making a lot of operations on the Internet. In this combination, we can distinguish 2 basic components: a client (requestor) and a server (service provider).
In this case, a client is any software connected to the network that sends requests and processes responses from a server.
Clients can be:
- Web browsers;
- Mobile software;
- Smart built-in home appliances;
- Various server applications.
A server is a virtual machine connected to the network. Its main task is to get requests, process them, and send client data in a particular format.
Servers can be:
- A local webserver;
- Any server based on HTTP;
- Specialized sets of server machines.
Web browser starts a dialogue with a server based on HTTP protocol. It sends a request specifying what data it is expecting to receive. When the server gets and processes a request, it sends the browser a message (so-called HTTP response) containing requested information (usually, it’s HTML file). Such messages include data and special codes of the current state that help web browsers to define whether the incoming request was successfully processed or not.
The final result of the request processing that is always in the first line of the server’s response is called a response code or a state code of the current state. Moreover, these messages are sent whenever a web browser interacts with a server, even if the user of the site doesn’t see them.
Types of response codes
We can divide all the response codes into several classes. A state class is marked with 1 number that defines a state of a web page. Two other numbers are of a clarification nature.
There are 5 classes of the status codes:
- 1xx – a group of information codes. Their task is to process information, make a message informing that current request is received, and transmit data.
- 2xx – successful processing of requests. A server has already received the request and successfully processed it without any errors.
- 3xx – redirect. This code notifies users about the current necessity to sent requests to another address if the file has been moved.
- 4xx – client errors. These errors mean that a system didn’t find particular file at the requested address.
- 5xx – server errors. It indicates that there was a server failure when performing the request.
To know the status code of a request in a web browser, you need to open a developer toolbar. The value of the code will be available in the “Status” column in the “Network” tab. After the console is open, you have to refresh the page.
HTTP Error 404
Bad request – means that request was written incorrectly (obviously, there is a syntax error in the request body). A client can try to upload a huge file. Because of this, the request can be incorrect, HTTP titles can have errors, etc.
- Antivirus is blocking web browser performance;
- Windows firewall is blocking web browser performance;
- Incorrect configuration of a web browser;
- And finally, it can be poor Internet connection.
HTTP Error 403
Forbidden – current request cannot be processed due to some access restriction to requested data.
- An error in the i-number;
- A server doesn’t have access to necessary information;
- A group of files is located in the incorrect directory.
HTTP Error 404
Not Found – common error in the Network. It indicates that a system cannot find some files at the current address. Usually, people see this error when they use so-called broken links.
- Nonexistent URL;
- There are no requested files and configurations on the current server.
HTTP Error 500
Internal Server Error – there can be an unexpected situation on a server that is easily classified as other well-known network error code.
Reasons for that:
- A server doesn’t run a scenario;
- Script has a lot of errors;
- Incorrect syntax of the.htaccess file (the incorrect construction was written).
HTTP Error 502
Bad Gateway – a server gets a response about an error or that there is no connection from the following virtual server which it has referred to.
- Insufficient capacities of the server’s resources;
- Incorrect performance of the proxy server.
HTTP Error 503
Service Temporarily Unavailable – current server unavailability that is caused by some technical issues.
Reasons for that:
- Firstly, a server can be overloaded;
- Secondly, a server may be in maintenance at the moment.
Almost every tester during everyday activities deals with different checks of requests and defects connected with it. When testing the UPL performance, a significantly important thing is a server response code, especially the one that leads to a nonexistent page (HTTP error 404).
Undoubtedly, when specialists perform testing of any program interface, they use the HTTP requests. A server, therefore, can send different codes to all the client’s requests. These codes show errors or inform the user about the current state of the server.
API (application programming interface) allows providing users with this data. The process of data exchange and the format of transferring information is fairly structured. Hence, the client and server know how they should interact.
API helps quickly find and identify such software bugs as:
- Incorrect data performance;
- Duplication or general lack of functionality;
- Some issues with API security;
- Incorrect functioning of the web security system;
- Incorrect structure of responses;
- Some issues with multithreading.
Today, not only IT specialists have to understand the peculiarities and nature of HTTP errors. First of all, codes are connected with specifics of resource performance. They notify a client about the current state of a web page.
Due to the information given by any error code after user request, a server can change the data processing. In a situation when there is an error and you now the result of the request, you can solve the issue by yourself.
Additionally, we’d like to say that such a diagnostic of error code (when performing security testing) allows finding vulnerabilities in the software under test.