Re: REST and DELETE?

Darrel Miller <[email protected]>
Newsgroups gmane.comp.web.services.rest
Message-ID <CAKioOqt7m9qobBVkYSnnbNSG-cFHoCCijk37r9DYvMizeA1=UQ@mail.gmail.com>
Mark,

On Thu, Aug 9, 2012 at 3:14 PM, Mark Baker <[email protected]> wrote:

> **
>
> That's not self-descriptive, it's just "descriptive".
>
> Self-descriptive is where the message's meaning depends only on the
> message itself (as interpreted by referenced standards).
>
>
This is one of the issues that I still fail to grasp.

Consider that I want to order a item from a store that has their own custom
media type for placing the order.

POST /order
Content-Type: application/vnd.aonlinestore.orderform

<order>
   <partno>1234232323</partno>
   <qty>1</qty>
   <price>51.99</price>
</order>

I am assuming that this message is considered sufficiently self-descriptive
based on the semantics defined in the custom media type spec .  Although, I
do have to trust that the store does not redefine what that part number is
used to represent between the time I create the cart and the time I place
the order.

So what happens if the store decides in it's wisdom to use URIs to identify
products, and so the message would be,

POST /order
Content-Type: application/vnd.aonlinestore.orderform

<order>
   <partno>http://aonlinestore.com/products/1234232323</partno>
   <qty>1</qty>
   <price>51.99</price>
</order>

Now the partno is a link to another resource that describes the product.
 Are we still self-descriptive?

What if the store decided that using SKUs (stock keeping units) was a
better option and so now a quantity isn't necessary.

POST /order
Content-Type: application/vnd.aonlinestore.orderform

<order>
   <sku>http://aonlinestore.com/sku/1234232323Q1</sku>
   <price>51.99</price>
</order>

Now my order is even more dependent on an external resource to identify
what I am buying.

At which point, I don't see the difference between this last message and
going a step further and creating a resource out of my desire to purchase
something, and then using that in my message.

POST /order
Content-Type: text/uri-list

http://aonlinestore.com/user/234/requisition/3453/line/1


As a user, I am expressing the intent "please order the thing I told you
that I wanted to order".  If, as you mention on your blog post, the price
has changed since the requisition was made, the user can still be informed.

I don't understand how it is that we lose self-descriptiveness by using a
link to a resource in our message.  Or have I mis-understood the guidance?

Darrel
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.