http with the server.One of the important part

http protocol is always organized around a client sending a request to a server.The client sends the request and the server respones with the response according to the request submitted by the client.Message is nothing but the chunk of data flowing through the network connection used by client while talking with the server.One of the important part of the request is that the client is asking the server to perform on its behalf. So every request has a request method and every request is a action or HTTP verb that a client is asking the server to take on its behalf.All the requests are send to the server as various Request method that are needed to be applied on a particular resource on the server-side followed by request headers and finally there is body or content if needed to be sent after a blank line. Resource will be basically a path of the content or file.REQUEST METHODS:  Method is used to indicate the server what to do. ->the GET method is used for asking the server to get the mentioned resource and return it to us.Basically it is used for retriving the content along with status line and headers.  ->HEAD method is just like the GET but instead of providing whole resource body it is used for retriving only the headers and the status line.  ->the POST method is used to send the data to the server by the client for processing or storing the data in its database.  ->PUT method is used for creating or replacing a resource with the content specified in the body which is in the request i.e. if the resource specified in the URI exists the that resource will be replaced by the body and if the resource in the URI does not exist the that particular resource will  be created.  ->DELETE is used for deleting a resource mentioned from the server. ->CONNECT method is used to establish a connection between a client and a server over HTTP. ->Using OPTION method we can find out various methods supported by the server. So upon receiving the OPTION request the server will return what are the possible methods supported by the server.     ->On using the TRACE method the HTTP content echos back to the client. This is mostly used for the debugging process while developing, to check whether or not the content is altered by the intermediate servers or not.SAFE METHODS: The safe methods are those methods which do not change the conent of the server i.e it performs only read operation on the server’s database. The methods like GET,HEAD,OPTIONS and TRACE are safe methods as they returns only with the content and do not update anything on the server side, while the rest all the methods are not safe like POST,PUT,DELETE as they are used to enter,update or delete the content on the server side. IDEMPOTENT METHODS:  The idempotent methods are those methods which can be called upon as many as time as possible either once or hundred times but the result will be the same.E.g GET method will everytime return the same resource no matter how many times same url is executed. Similarly HEAD,PUT,DELETE,OPTIONS and TRACE are idempotent methods while POST is not a idempotent as calling POST many times will generate false updates or a redundant database.Request Headers: Along with these requests the request headers are also sent to the server containing the information such as type, version and capabilities of the request browser.RESPONSE: Response are replies or responses which are returned to the client by the server. These Responses varies according to the different requests received by the server. Resposes starts of with a status line. Status line basically consists of the protocol version like 1.0 or 1.1 followed by status code and explaination of the code. After status line the next lines are of various response headers. Finally after a blank line there is content. STATUS CODE: Status code depicts the reply by the server according to the request send by the client. Status code is basically a 3 digit number that starts with 1,2,3,4 or 5.  The codes starting with 1 technically known as 1XX series shows informational response. eg. status code 100 is used to show that the client can “continue” with rest of the request. The codes for showing success starts with 2 technically represented by 2XX series. eg. status code 200 shows OK. 3XX series are used to reply the client for a Redirection which is basically a URL redirection. eg. 301 shows moved permanently. The status codes starting with 4 shows client side errors like not found(404), unauthorized(401), forbidden(403). For showing the server side errors the 5xx series is used as status code in the response. eg. 500 used to show the Internal server error. Response Headers: After status line in the http response there are various headers. These provides the knowledge of the server to the client and about further access to the file or content mentioned in the request message.