HTTP Request Methods
HTTP Request methods:
GET : When url or http request triggered with get method it requests the server to get the requested information or data from the server. It retrieves the existing data from the database. Get method retrieves all the information which are requested through url from the resource without doing any change in data or information in the server.
POST : When url or http request triggered with Post method it sends the data to the server or database. For example post user information or post customer profile or post xml file. Its not necessary that post method will give all the time correct result. To get the correct result you need to post the correct information that should be accepted by the server .
PUT : When url or http request triggered with Put method it sends the data to the server or data base and modify the data. There should not be confusion in PUT and POST method as Post method inserts the data, however PUT method modifies the existing data. PUT method generally used for the replacement of the data or to upload the new data to the web server.
DELETE : When url or http request triggered with DELETE method it deletes the existing data from database for which request is triggered to the web server. Using DELETE method we could delete all the data or we could request to delete any data with specific information identified by the web url. i.e. id or name or contact etc.
HEAD : HEAD method is similar to GET method but head method is used to get response from the server for only additional information that is asked through the web service url. Server does not return the message body for head request. By triggering HEAD method we can get the last modified server date of server file. Generally if you want to find some additional information from the server response you can specify header information with the url triggered.
PATCH : PATCH method is used to update any particular resource or data instead of complete data. PATCH method is really useful when you want partial update as its difficult to update data partially for any API. Unlike the PUT method, the PATCH method does not delete any local resource properties that are not included in the request. The PATCH method must be specified by using the x-method-override header.
OPTIONS : This method is used to get the information from the server that what all methods (GET,POST,PUT,DELETE etc) that server could support. Generally OPTIONS is not exactly the http method and also OPTIONS could not be triggered likely other methods. For OPTIONS request we need to design our own custom request.
TRACE : This method is used to trace the information like proxy or intermediate server information. It depends on the server configuration whether server is allowed to provide these information of not.
Leave a Reply