Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Difference between PUT and POST in REST WebService in Java

If you remember Rest WebServices uses HTTP methods to map CRUD (create, retrieve, update, delete) operations to HTTP requests. Even though both PUT and POST methods can be used to perform create and update operation in REST WebServices, Idempotency is the main difference between PUT and POST. Similar to the GET request, PUT request is also idempotent in HTTP, which means it will produce the same results if executed once more multiple times. Another practical difference PUT and POST method in the context of REST WebService are that POST is often used to create a new entity, and PUT is often used to update an existing entity. If you replace an existing entity using PUT than you should be aware that if only a subset of data elements is passed then the rest will be replaced by empty or null.
Read more »


This post first appeared on Javarevisited: Blog About Java Programmin, please read the originial post: here

Share the post

Difference between PUT and POST in REST WebService in Java

×

Subscribe to Javarevisited: Blog About Java Programmin

Get updates delivered right to your inbox!

Thank you for your subscription

×