Re: Self-descriptive messages
"Moore, Jonathan (CIM)" <[email protected]>
| Newsgroups | gmane.comp.web.services.rest |
|---|---|
| Message-ID | <[email protected]> |
Here's the definition of self-descriptive from Roy Fielding's thesis: "REST enables intermediate processing by constraining messages to be self-descriptive: interaction is stateless between requests, standard methods and media types are used to indicate semantics and exchange information, and responses explicitly indicate cacheability." Now let's look at Darrel's example of POSTing a single URI to the "order this" resource. 1. Interaction is stateless between requests. Check; the client need never have talked to the ordering resource before. 2. Standard methods and media types are used. Check (POST) and check (text/uri-list). 3. Responses explicitly indicate cacheability. Since this exchange is carried over HTTP, the response has well-defined cacheability according to its headers. So I think this request is completely self-descriptive according to the definition. "Semantics are indicated" through the use of POST, and the "information exchanged" is a single URI, which is a perfectly fine piece of data. Jon ........ Jon Moore On Aug 24, 2012, at 8:30 PM, "Mark Baker" <[email protected]<mailto:[email protected]>> wrote: Hey Darrel. I think I did answer your question, at least by addressing the most subtle point you raised in the sku message. I hope its clear after reading my explanation that your last message was not self descriptive because you used the text/uri-list media type. Also, you'd find that designing a media type to be able to self-descriptively encapsulate everything you need to know about a shopping cart in a single URI, is intractable. It makes for an interesting thought exercise but is practically unworkable. P.s. never too late to change the subject line :-) Mark.