Wednesday, March 1, 2017

HTTP Status Codes and their Purpose

In this article i am going to describe each of the status codes available for use in servlets talking to HTTP clients,along with the standard message associated with each code. Http(Hyper Text Transfer Protocol) is that web browsers and servers use to transfer hyper text pages and images. Here is how it works. When a client requests a file from an HTTP server an action known as a hit,it simply sends name of the file in a special format and server responds back to the content of the file. The server also responds with a status code to tell the client whether or not the request can be fulfilled.

The following are the specific status codes and their purpose:






HTTP status codes indicate whether a specific  HTTP request has been successfully completed. These responses are categorized in five classes they are informational responses,successful responses,client errors,server errors,redirects. Now we will discuss one by one.

Information responses:

100 continue:

This response indicates that everything so far is OK and that the client should continue with the request or ignore if it is already finished. 

103 Processing:

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

Successful Response:

200 OK:

This response indicates the request has succeeded. That means successfully completed their respective method through sending HTTP Request. The methods might be GET(),POST(),Head().

201 Created:

The request has succeeded and new resource has been created as a result of it.



 Redirection Messages:

300 Multiple Choice:

The request has more than one possible responses. User should choose one of them. There is no standard way to choose one of the responses.

301 Moved Permanently:

This response code means that URI of requested resource has been changed.

305 (use Proxy):

 This means requested response must be accessed by a proxy. This response code is not largely supported because security reasons.

Client Error Response:

400 (Bad Request):

This response indicates that server could not understand the request due to invalid syntax.

401 (Unauthorized):

Authentication is needed to get requested response. That means client does not have access rights to the content so server is rejecting to give proper response.

404 (Not Found):

This response indicates that server can not find requested resource. This is most famous one due to its frequency to occur in web.

Server Error Response:

500 (Internal Server Error):

This indicates that the Server has encountered a situation it doesn't know how to handle.

505 (HTTP version not supported):

This response indicate that the HTTP version used in the request is not supported by the server.

  Watch video:  Best HTTP Status codes and their meaning
 See Also:

Difference Between doGet() and doPost() methods
Spring Interview questions
JSP Interview Questions
MVC Architecture in Java

 

 

     

  

 

No comments:

Post a Comment

High Paying Jobs after Learning Python

Everyone knows Python is one of the most demand Programming Language. It is a computer programming language to build web applications and sc...