What is the main difference between PATCH and PUT request?

后端 未结 8 2006
悲&欢浪女
悲&欢浪女 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.

提交回复
热议问题