Difference between PUT and POST HTTP Request

Both PUT and POST requests have a strong connection with HTTP. Both have many resemblances and differences as well. This article includes some major differences between PUT and POST HTTP requests.

What is a PUT HTTP Request?

The PUT HTTP request method is used to revise or modify the resources obtainable on the server. Generally, it modifies the specific resource at the target URL with some other resources.

What is a POST HTTP Request?

The POST HTTP request method is used to add a resource to an existing group.

Difference between PUT and POST HTTP Request

S.No. PUT POST
1 The PUT method is considered idempotent. In this method, if we send a request several times, it will be counted as a single request modification. The POST method is considered idempotent. In this method, if we send a request multiple times, then multiple URLs will get created on the servers.
2 The PUT method is used to modify a single resource. The POST method is used to add a child resource.
3 It can be cached. It cannot be cached.
4 This method acts as specific. This method acts as an abstract.
5 In the PUT method, we use the UPDATE query. In the POST method, we use a CREATE query.
6 When it comes to the PUT method, the client finalises which URL resource should be updated. When it comes to the POST method, the server finalies which URL resource should be added.

Keep learning and stay tuned to get the latest updates on GATE along with GATE Preparation Books & GATE Answer Key and more.

Leave a Comment

Your Mobile number and Email id will not be published.

*

*