Re: Few questions about REST

On Thu, Sep 18, 2003 at 06:17:57PM -0400, Sergey Beryozkin wrote:
> Mark,
> > > Almost, but not quite 8-).  What you're missing is that POST - even when
> > > extended as you describe - cannot RESTfully be used to have any insight
> > > into what happens after the data has been submitted.  "echo" semantics
> > > are such that there exists an expectation that what is submitted, is
> > > returned.  It's that expectation which is not RESTful.
> I have to admit I'm somewhat confused. It seems to me that "echo" semantics
> are only 'visible' to a client and a service
> A generic intermediary would probably be confused because it's not aware of
> the semantics.

That's exactly right, and a good litmus test; if the intermediary is
confused, then it's not RESTful.

> Is it more RESTful to POST Person details first and then GET it back or ask
> a service to POST it to a provided URI, instead of combining it into a
> single POST ?

The former, since the latter requires asking the service to do something,
which you can't do RESTfully with POST (except to POST, of course 8-).

> I think that those uses of doc-lit SOAP which actually do RPC can be
> considered unRESTful (empty input bodies, or perhaps with some structures
> clearly representing parameters, many fine-grained invocations, etc)
>
> > > Here's one that I think is RESTful;
> > >
> > > http://www.w3.org/TR/soap12-part0/#Example
> 
> This is why I'm confused. This example seems to be very similar as the one
> with echoPerson.
> That example shows an input message, which is followed by a response asking
> for some clarifications.

Right, but the client didn't request that response.  It was just a result
of processing the data that was submitted.  Intermediaries wouldn't be
confused.

With "echo", the response is explicitly requested.  Intermediaries would
be confused.

> How POST in this example can be used RESTfully to
> see what happens after the data has been submitted ?

Well, you just POST the data, and see what you get back.  If it's a 201,
then you know a new resource was created in response to your POSTed
data, and you can invoke GET on that.  The POST response might also just
contain a link someplace else, which you can invoke GET on.

Mark.
-- 
Mark Baker.   Ottawa, Ontario, CANADA.        http://www.markbaker.ca

Received on Thursday, 18 September 2003 20:02:12 UTC