Difference between PATCH and PUT requests

PATCH does a partial update and PUT is used to update the whole resource.

Lets take an example

If PATCH request submitted with 2 fields for a resource with 8 fields, then only those 2 fields are updated and for PUT request the 2 fields are updated and others are set to their default/existing values.

Comments

  1. In rails when we use PUT and PATCH? Can you elaborate with example?

    ReplyDelete

Post a Comment

Popular posts from this blog

Inserting and Moving elements inside Ruby Array

Difference between Validations, Callbacks and Observers