Difference between GET, POST, HEAD, PUT, DELETE methods

An HTTP GET request is what you get  when you enter a URI in your browser or when you click on a link on a web page. Certain HTML elements, like also generate GET requests. GET requests a resource (usually a web page or an image) from the server. You can pass additional information to a server-side script by adding ‘query parameters’ after the script, such as example.com?foo&bar=42.

A POST request is similar to a GET request. The difference is that any additional information is sent in the body of the request, rather than as part of the URI. You can generate POST requests using elements in HTML, where the form field values are sent in the request body.

A HEAD request is also similar to a GET request, but the server responds only with the HTTP headers; the response body is empty.

A PUT request is a way to upload a file to a server. Most servers don’t allow PUT requests, because of the security implications.

Similarly, a DELETE request will delete a resource on the server. Like PUT, this method is rarely permitted on server for obvious reasons.

Add Comment