Explain difference between put and post?

Yasir
Yasir

Posted On: Apr 07, 2020

 

PUT inserts a resource or a file at the specified URI. If there is already a resource or file at the specific URI, it is then replaced by PUT. PUT is idempotent, but the responses of PUT are non-cacheable. The URI inside a PUT finds out the entity that is enclosed within a request.

A specific set of data is sent to the URI by POST. The resource present at that URI handles the request. The web server next determines what to do with the data in the specified resource. The POST is non-idempotent. The responses of the POST are cacheable as the server determines the ideal Expire Headers and Cache-control.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    Cognizant Java Interview Questions

    What is a Singleton in Java?

    Singleton class in Java contains only one object at one time. For the designing of the singleton class, the construction needs to be private. The static method needs to be written to return the object...

    Cognizant Java Interview Questions

    Is Java supports multiple inheritance?

    When one class extends for more than one class, then it is known as multiple inheritance. No, Java does not support multiple inheritance to prevent the ambiguity that it can cause. The diamond proble...

    Cognizant Java Interview Questions

    What is JPA and Junit?

    JPA or Java Persistence API is a mechanism through which JAVA can outlive the application processes that have created them. JPA allows you to define which objects are persisted and how they should be ...