Re: partial updates to same url?
Colin Taylor <[email protected]>
| Newsgroups | gmane.comp.web.services.rest |
|---|---|
| Message-ID | <CAN6ZwvvUzgsZKtVf--T2NqtD4hT3kzB4SHHLUnUXgRR+atxQWw@mail.gmail.com> |
On Sun, Oct 14, 2012 at 12:03 PM, Jan Algermissen < [email protected]> wrote: > > On Oct 14, 2012, at 12:49 AM, Colin Taylor wrote: > > > Hi, I need to do a partial update so I'm POSTing with Etag of whole > resource as precondition, i.e I'm POSTing to same URL as the resource. It > feels like I should be doing it to a sub URL though, but how do I reconcile > that with sending the Etag? > > Interesting question. > > I am not sure POST goes with Conditional update. Need to check the spec. > Spec gives an example of PUT as conditional update but doesn't rule out POST as far as I can tell... http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.24 > > Meanwhile - can you use PATCH? > What is the reality of browser PATCH support today? Regardless our API has always used POST so a bit loath to change conventions now. > > You'd need to roll your own little patch media type. Would be interesting > if you shared your use case. > Not dissimilar to your example. We have a resource which is basically a long list of statuses representing domains enabled for a service. Since the selection process is usually a one-off bulk selection, rather than put this lengthy list back and check for changes, we just POST back the changed statuses using the ETag to make sure the transitions are valid.