Status Codes and HTTP header

Praveen Fernando
3 min readJul 4, 2022

--

HTTP status codes are three-digit answers to browser-side requests from the server. These status codes (also known as response status codes) serve as a method of communication between the server and the internet browser, and there are several code classes dependent on the type of data being sent. These responses are grouped into five classes:

Information responses (100 — 199)

100 Continue

This code indicates that the client should continue the request or ignore it if the request has already been completed.

102 Processing

This code indicates that the server has received and is processing the request, but no response is available yet.

Successful responses (200 — 299)

200 OK

This code indicates that the request succeeded. The result of “success” depends on the HTTP method:

  • PUT or POST : The resource describing the result of the action is transmitted in the message body.
  • GET : The resource has been received and sent in the message body.
  • HEAD : The representation headers are included in the response without any message body.
  • TRACE : The message body contains the request message as received by the server.

201 Created

This code indicates that as a result of the request’s success, a new resource was generated. This is often the answer delivered in response to POST or PUT queries.

Redirection responses (300 – 399)

300 Multiple choices

This response code indicates that there are several possible responses to the request. One of these should be chosen by the user agent or the user.

302 Found

This response code indicates that the requested resource’s URI has been temporarily modified. It’s possible that the URI will change again in the future. As a result, the client should use this same URI in future queries.

Client error responses (400 — 499)

400 Bad Request

This response code indicates the client’s fault, the server is unable to or unwilling to perform the request.

403 Forbidden

This code indicates because the client lacks access privileges to the material, it is unauthorized, and the server refuses to provide the requested resource.

Server error responses(500 – 599)

500 Internal Server Error

This code indicates the server has encountered a situation it does not know how to handle.

502 Bad Gateway

This error response indicates that the server while acting as a gateway to obtain the answer required to handle the request, received an incorrect response.

References

--

--