users@jersey.java.net

Re: [Jersey] Re: Re: Re[Jersey] ading entity body

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Thu, 23 Oct 2008 17:51:57 +0200

On Oct 23, 2008, at 5:24 PM, Gili wrote:

>
>
> Paul Sandoz wrote:
>>
>>> Actually I was going to use PUT for both partial and full updates.
>>>
>>
>> That would be against the semantics of PUT.
>>
>
> According to who or what?

http://greenbytes.de/tech/webdav/rfc2616.html#PUT

Which is why the following draft has been created:

http://greenbytes.de/tech/webdav/draft-dusseault-http-patch-11.html

"A new method is necessary to improve interoperability and prevent
errors. The PUT method is already defined to overwrite a resource with
a complete new body, and can not be reused to do partial changes.
Otherwise, proxies and caches and even clients and servers may get
confused as to the result of the operation."


> "RESTful Web Services" page 300 reads "If the
> resource already exists, parse the representation and turn it into a
> series
> of changes to the state of this resource. If the changes would leave
> the
> resource in an incomplete or inconsistent state, send a response
> code of 400
> (“Bad Request”)."
>
> I interpret this as meaning that PUT can be used for partial updates.
>

I think it is describing what a server-side implementation would do to
process the request entity body and detect errors related to an
incompatibility.

Paul.