The HTTP verb named PATCH can be used for partial updates, i.e., when you would like to update just a few fields of a resource. While you could update a resource “partially” using HTTP PUT, by sending the entire resource with the updated values, that is potentially problematic.

At the very least, you might end up consuming more network bandwidth than necessary.For partial updates, HTTP PATCH is easier and safer, and ASP.NET Web API provides excellent support for HTTP PATCH requests.

This article will discuss how we can use PATCH to perform partial updates when working with RESTful services using Web API.[ Discover the power of Bash on Windows. | The power of PowerShell: PowerShell intro for Windows Server admins • PowerShell intro for Exchange admins • Essential PowerShell scripts for security admins • All about PowerShell providers and modules. | Keep up with hot topics in programming with InfoWorld’s App Dev Report newsletter. ]
PATCH vs. PUT
The HTTP PATCH method should be used whenever you would like to change or update just a small part of the state of the resource. You should use the PUT method only when you would like to replace the resource in its entirety. Note that PATCH is not a replacement for PUT or POST, but just a way of applying a delta update to a resource representation. Roy Fielding, who authored the REST architectural style and many web standards, said that he created PATCH because “partial PUT is never RESTful.”To read this article in full or to leave a comment, please click here

Leave a Reply