HTTP Status Codes

Introduction

We are going to discuss HTTP Status Codes in this article. HTTP Status codes help us to identify website errors quickly.

We will discuss,

  1. What is HTTP Status Codes
  2. Important HTTP Status codes
  • 1.xxs: Information
  • 2.xxs: Success
  • 3.xxs: Redirection
  • 4.xxs: Client error
  • 5.xxs: Server error

What are HTTP Status Codes?

Let’s see the below image first and then we will discuss more about HTTP Status Codes.

HTTP Status Code

Whenever the user tries to access your website, the browser sends a request to the server. The server processes the request and response with a three-digit code. That code is called the HTTP Status Code.

This HTTP Status Code gives status about conversion between browse and server and indicates success, failure, and other statuses.

I hope you got a basic idea about HTTP Status Codes.

Let’s discuss some important HTTP Status Codes.

HTTP Status Codes have five important categories,

  • 1xxs – Informational:
  • 2xxs – Success: Request completed and expected response given to the browser from Server.
  • 3xxs – Redirection: The server received the request, but it was redirected somewhere else.
  • 4xxs – Client error: The client seems to have an error or Page not found.
  • 5xxs – Server errors: A valid request from the client, but it failed at the server.

Let’s discuss all of it in detail,

There are many HTTP Status codes available in each section, but we will cover important HTTP Status codes only.

1.xxs: Information Response

It informs the client that the request is continuing.

HTTP Status Code Details What HTTP Status Code Indicates
100 Continue HTTP session is in progress as expected, and asking the client to continue to the next step. The HTTP response is only sent when the client includes the HTTP header request field Expect.
101 Switching Protocols HTTP session can continue, and the server is switching to the new protocol. The HTTP response is only sent when the client includes the HTTP header request field “Urgrade” or “Connction Upgrade”.
102 Processing Significant delay in the HTTP Response, so inform the client not to timeout early.


2xxs – Success
 

HTTP Status Code Details What HTTP Status Code Indicates
200 OK Indicate Successfully completed.
201 Created It indicates that the Resource was successfully created by the HTTP request.
202 Accepted HTTP Request has been received successfully, but processing is not yet completed.
204 No Content HTTP request has been successfully completed, and there is no message body.


3xxs – Redirection

This HTTP Status code indicates errors related to redirection and resource unavailability.

HTTP Status Code Details What HTTP Status Code Indicates
300 Multiple Choices Indicate that more than one HTTP Response is available for an HTTP Request. The Client has to decide which best fits their requirements.
301 Moved Permanently Indicates that requested resources have been given a new permanent location.
302 Temporary Redirect Indicate that requested resources have temporarily moved to the new location.


4xxs – Client error

These HTTP Status codes indicate client-side issues.

HTTP Status Code Details What HTTP Status Code Indicates
400 Bad Request Indicate that the client did something wrong.
401 Unauthorized Indicate that a valid login credential needs to be supplied to access resources. HTTP must be authenticated.
403 Forbidden Indicate that the client doesn’t have sufficient permission to access the resources.
404 Not Found Indicate that the resource cannot be found at the specific address.
429 Too Many Requests Indicates that too many requests were made in the allowed time.


5xxs – Server errors

This HTTP status code indicates that there is an error on the server side. Let's look at some important HTTP status codes.

HTTP Status Code Details What HTTP Status Code Indicates
500 Internal Server Error Indicate generic error on the server Side.
501 Not Implemented Indicate it does not support a specific feature that is mandatory to complete the request.
502 Bad Gateway In this case, it acts as a proxy/Gateway and has received an invalid response from the upstream system.
503 Service Unavailable Indicate that the page or resources are not available. It shows the temporary problem.
504 Gateway Timeout Indicate that there is no response from the upstream system, and it acts as a gateway/proxy.

I hope you like and enjoy this article.