What is the main difference between PATCH and PUT request?

后端 未结 8 1937
悲&欢浪女
悲&欢浪女 2020-11-28 01:18

I am using a PUT request in my Rails application. Now, a new HTTP verb, PATCH has been implemented by browsers. So, I want to know what the main di

相关标签:
8条回答
  • 2020-11-28 02:01

    There are limitations in PUT over PATCH while making updates. Using PUT requires us to specify all attributes even if we want to change only one attribute. But if we use the PATCH method we can update only the fields we need and there is no need to mention all the fields. PATCH does not allow us to modify a value in an array, or remove an attribute or array entry.

    0 讨论(0)
  • 2020-11-28 02:05

    Put and Patch method are similar . But in rails it has different metod If we want to update/replace whole record then we have to use Put method. If we want to update particular record use Patch method.

    0 讨论(0)
提交回复
热议问题