Re: diff + HTTP PATCH == wrong?

Peter Williams <[email protected]>
Newsgroups gmane.comp.web.services.rest
Message-ID <CAK5VdzzcDCKYm4VV7SpZhgDo9mLq+AtmzFOMTHQVGJrHjdC8jA@mail.gmail.com>
On Thu, Jul 26, 2012 at 10:04 AM, Steve Klabnik <[email protected]> wrote:
> PUT requires a full replacement

PUT has replacement semantics, not fullness semantics. This is
obviously the case because you don't have to provide each and every
representation of a resource. Further, the server may modify the
provided representation in any way it sees fit before actually
performing the replacement.

This leaves us with the logical conclusion that PUT requests should
include a complete enough representation to allow the server to
construct all the representations it needs. Complete enough can only
be defined by the server and/or the media type. So PUT has replace
semantics, full stop. If the server can "replace" the existing
representations with representations constructed from the
representation in a particular PUT request it should do so.
(Regardless of what anyone else thinks of the "fullness" of that
representation.)

Peter
barelyenough.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.