Analyzing HTTP responses
In this section, we will learn about the different HTTP response status codes and different classes of HTTP response codes.
Then, we'll write examples to see successful responses or errors, and finally, we'll see a redirection example.
HTTP codes
The HTTP protocol defines five classes of response codes to indicate the status of a request:
- 1XX-Informational: The 100 range codes are used for informational purposes. It is only present in HTTP/1.1.
- 2XX-Success: The 200 range of codes are used to indicate that the action requested by the client was received, understood, accepted, and processed. The most common is
200 OK
. - 3XX-Redirection: The 300 range indicates the client that must take additional actions to complete the request. Most of these codes are used in URL redirection. The most common of this group is the
302 Found
code. - 4XX-Client-side error: The 400 range are used to indicate that the client has had an error. The most common is
404 Not Found
. - 5XX-Server-side error...