Re: REST and DELETE?
Mike Kelly <[email protected]>
| Newsgroups | gmane.comp.web.services.rest |
|---|---|
| Message-ID | <CANqiZJY0nUXVjC8wKs6y0BkMfFi=w+haE0ayieEcWw1wUmPXtw@mail.gmail.com> |
On Thu, Aug 9, 2012 at 7:05 PM, Mark Baker <[email protected]> wrote: > On Thu, Aug 9, 2012 at 5:29 AM, Mike Kelly <[email protected]> wrote: >> Does it _have_ to contain all the state? The following would work ok, >> and the important parts of the interaction are still visible: >> >> POST /cart/123 >> If-Match: 2930480293842 >> <state>reserve-to-pay</state> > > It has to contain all the state if you want the message to reflect the > intent of the user, yes. That message is not self-descriptive. I don't think it's correct to characterise self-descriptiveness in boolean terms. There's a whole continuum of self-descriptiveness, and some parts of an interaction do not necessarily need visibility. For example, if my API requires clients to include headers for their star-sign, what their favourite episode of Friends is, and rating of their current happiness levels out of 10.. it's "more self-descriptive" than your API but not in a useful way, as the primary purpose of self-descriptive messaging is to enable intermediate processing. I don't think my example reduces the intermediate processability of the interaction in a significant way, so I don't think it's a lot less self-descriptive, and it's definitely self-descriptive in a useful sense: an invalidating request has been made altering the state of the /cart/123 resource. Cheers, M