html

HTTP Request Methods | Explained

HTTP acronym for HyperText Transfer Protocol is a commonly used internet protocol that allows the server-side and the client-side to communicate with each other. This protocol works in a fashion that a client has to make a request to perform a certain task and that request is sent to the server-side for processing. After being processed the server-side sends a certain response to the client regarding the request made.

There is a wide range of methods that a client can use to make requests to the server over HTTP. Let’s explore some request methods in detail.

HTTP Request Methods

HTTP request methods that are frequently used are as follows.

  1. GET Method
  2. POST Method
  3. PUT Method
  4. HEAD Method
  5. DELETE Method
  6. PATCH Method
  7. OPTIONS Method
  8. CONNECT Method
  9. TRACE Method

Let’s explore them in-depth.

GET Method

The GET method is the most common type of HTTP request method that is used to extract data from a resource. The data is extracted by stating the parameters in the URL.

The requests made using the GET Method are stored in the browsing history and therefore can be cached. Moreover, these requests can be bookmarked thus these should never be used for extracting sensitive data. Furthermore, these have limited lengths and can not be used to modify data.

POST Method

The POST Method is another type of most commonly used HTTP request method. This method to modify a resource. The modification of a resource means that either the client-side has requested to generate an entirely new resource or update an existing one.

The requests made using the POST method are not stored in the browsing history and therefore can not be cached. Moreover, these requests have no limitations in terms of length and can be bookmarked.

PUT Method

The PUT method is a type of HTTP request method that is used to request the server-side to either generate an entirely new resource or update an existing one. This method is similar to the POST method, however, what makes it different is that unlike the POST method when this request is made multiple times then each time the new resource generated will replace the old one.

Meanwhile, the new resource generated as a result of making a POST request multiple times will not replace the old one rather it will be saved as many times as the request was made.

HEAD Method

The HEAD method is used to extract information from a particular resource. This HTTP request method is similar to the GET method but what makes it different is that, unlike the GET method, the response body of HEAD requests contains nothing except for the response line and headers.

DELETE Method

As the name suggests, the DELETE method is used to entirely remove a resource from a location specified in the URL.

PATCH Method

A request that is made using the PATCH method is a series of instructions that implement partial changes to the targeted resource.

OPTIONS Method

For the purpose of evaluating the various options of a particular resource such as the type of HTTP methods supported by that resource, the OPTIONS method is used. These options can be explored by specifying them in the URL or by using an asterisk (*) sign to evaluate the entire server.

CONNECT Method

As the name suggests, the CONNECT method is used by the client-side to build a connection to a server.

TRACE Method

The TRACE method reflects the content of an HTTP request back to the client.

Conclusion

The methods used to make a request from the client-side to the server-side over HTTP are referred to as the HTTP request methods. The most frequently used HTTP request methods are GET and POST methods. The GET method is used to extract data from a resource, however, the POST method is used to modify a resource. Other request methods are PUT, HEAD, DELETE, PATCH, OPTIONS, CONNECT, TRACE, etc. In this write-up, we have discussed these request methods in detail.

About the author

Naima Aftab

I am a software engineering professional with a profound interest in writing. I am pursuing technical writing as my full-time career and sharing my knowledge through my words.