How to submit RESTful partial updates?

Gili picture Gili · Oct 24, 2008 · Viewed 11.3k times · Source

Sam Ruby, author of "RESTful Web Services" seems to come out against the use of HTTP PUT for partial updates: http://intertwingly.net/blog/2008/02/15/Embrace-Extend-then-Innovate

What isn't clear is how partial updates should take place. As I commented near the bottom of his blog, it isn't clear how using HTTP PATCH is any better than using a "patch document" against HTTP PUT.

It is worth noting that although Sam comes out against misusing HTTP PUT he doesn't seem to advocate the use of HTTP PATCH either.

How should one submit RESTful partial updates?

Answer

Darrel Miller picture Darrel Miller · Oct 24, 2008

As you can see from the comments in the blog post you referenced there is no agreed upon way to do partial updates. If heavyweights like Sam Ruby, Joe Gregario, Mark Nottingham, Mark Pilgrim, Bill de hÓra, etc cannot come to an agreement, what hope do we have.

As far as I am concerned, I wouldn't worry too much. Create a partial update media type that works for you, use PATCH to indicate your intent and when agreement is finally reached on a general purpose media type, change your server to accept both formats.

Be thankful that if the worst sin your REST api commits is abusing PUT/PATCH then you are doing pretty well.