On Oct 24, 2008, at 1:53 AM, Gili wrote:
>
> It seems I'm going to have to eat my own hat:
> http://intertwingly.net/blog/2008/02/15/Embrace-Extend-then-Innovate
>
> One of the authors of "RESTful Web Services" whose book I was
> quoting comes
> out against using HTTP PUT for partial updates.
The HTTP spec is the canonical source of why PUT should not be used
for partial update. Now i agree the HTTP spec could be better worded :-)
> He doesn't actually advocate
> the use of HTTP PATCH. He questions the need for partial updates
> altogether.
>
> I find http://greenbytes.de/tech/webdav/draft-dusseault-http-
> patch-11.html
> very confusing in the sense that it talks about "patch documents"
> yet never
> defines any or gives any examples. Sam Ruby writes "My concern is with
> clients coding with to the assumption as to how the server works.
> That’s
> called coupling." I get that, but I fail to see how HTTP PATCH
> addresses
> that at all. Clients will *still* make assumptions about how the
> server
> works (for both PUT or PATCH) unless the server uses a format that
> discusses
> its behavior explicitly. Again, I don't see how using PATCH instead
> of PUT
> solves this problem. I am honestly interested in a clear explanation.
>
Note that i was not proposing that you use PATCH. My reason for
referencing it was to present evidence that PUT does not support
partial update.
The key as you allude to above is the media type. These are very
important and define how representations are processed for the fixed
semantics of the HTTP methods. You may find Roy Fielding's latest
blog entry and comments useful in this respect:
http://roy.gbiv.com/untangled/
> BTW: Jersey doesn't seem to support HTTP PATCH out-of-the-box. I
> assume it's
> easy to provide this support ourselves?
>
Yes, as sent in a previous email by Jeff.
Paul.