HTTP Status Code

The Server issues an HTTP Status Code in response to a request of the client made to the server. Status code is a 3-digit integer. The first digit of status code is used to specify one of five standard classes of responses. The last two digits of status code do not have any categorization role.

The status codes are divided into 5 parts, as follows:

S.N.Code and Description
11xx: Informational Response
It is used to show that the request was received, and the process is continuing.
22xx: Successful
It is used to show that the request was successfully received, understood, and accepted.
33xx: Redirection
It is used to show that further action needs to be taken to complete the request.
44xx: Client Error
It is used to show that the request contains bad syntax or cannot be fulfilled.
55xx: Server Error
It is used to show that the server is failed to fulfill an apparently valid request.

HTTP status codes are extensible. The application of HTTP is not required o understand the meaning of all the registered status code. A list of all the status codes is given below:

1xx: Information

MessageDescription
100 ContinueIt is used to show that the client should continue with its request. The interim response informs the client that the request?s initial part has been received.
101 Switching ProtocolsIt is used to switches the server.
102 ProcessingThis code is used to show that the server has received and is processing the request. It indicates that no response is available yet.
103 Early HintsThis code is used to return the headers of some responses before the final HTTP message.

2xx: Successful

MessageDescription
200 OKThis code is used to show that the request is OK.
201 CreatedThis code shows that the request has been fulfilled, which results in the creation of a new resource.
202 AcceptedThis code shows that the request is accepted for processing, but not yet processed completely.
203 Non-authoritative InformationIn the entity-header, the information is from a local third party copy. It is not from the original copy.
204 No ContentThis code is used to show that the request is processed successfully by the server and not returning any content.
205 Reset ContentThis code is used to tell the user agent to reset the document which sent this request.

3xx: Redirection

MessageDescription
300 Multiple ChoicesThis code is used to indicate that the multiple options for the resource from which the client may choose.
301 Moved PermanentlyThis code shows that the URL of the requested resource has been changed permanently. In response, the new URL gives.
302 FoundThis code is used to show that the requested page has moved temporarily to a new URL.
303 See OtherThis code is used to show that the requested page can be found under another URL using the GET method.
304 No ModifiedThis code is used for caching purposes. It shows the client that the response has not been modified, so the client can continue to use the same response?s cached version.
305 Use ProxyThis code is used to show that using the proxy; the requested URL must be accessed, which is mentioned in the Location header.
306 UnusedIn the previous version, this code is used. This response code is no longer used, and it is just reserved.
307 Temporary RedirectThis code is used to show that the requested page has moved temporarily to a new URL.

4xx: Client Error

MessageDescription
400 Bad RequestThis code is used to indicate that the server did not understand the request due to invalid syntax.
401 UnauthorizedIn this code, the requested page needs a username and password.
402 Payment RequiredThis code reserved for future use.
403 ForbiddenThis code is used to show that the access is forbidden to the requested page.
404 No FoundThis code is used to show that the server cannot find the requested page.
405 Method Not AllowedIt shows that the request method is not supported for the requested resource.
406 Not AcceptableIt is used to show that the server can only generate a resource that the client does not accept.
407 Proxy Authentication RequiredIt is used to show that the client must first authenticate itself with the proxy.
408 Request TimeoutThis code is used to show that the request took longer than the server was prepared to wait.

5xx: Server Error

MessageDescription
500 Internal Server ErrorThis code is used to show that the server has encountered a situation, and it does not know how to handle it.
501 Not ImplementedThis code shows that the request was not completed, and the server did not support the functionally required.
502 Bad GatewayThis code shows that the request was not completed, and the server received an invalid response from the upstream server.
503 Service UnavailableThis code shows that the request was not completed, and the server is temporarily overloading or down.
504 Gateway TimeoutIt shows that the gateway has timed out.
505 HTTP Version Not SupportedThis code is used to show that the server does not support the "http protocol" version.

Next Topic#




Latest Courses