Re: [rest-discuss] How much REST should your Web API get?
- On May 4, 2013, at 9:35 AM, Jørn Wildt <jw@...> wrote:Allow me to disagree with you here. Why do you consider this as being stateful? I don't see how this has anything to do with it.Unless everything in your API can be done with at most two HTTP requests (I had not considered that potential) then it would seem your 3rd HTTP request would be assuming the state of your 1st request and thus your API not RESTful. If not, then how not stateful?But isn't that exactly what I am proposing? We have one single initial URL, the client GETs the service document representation there and selects among the hyper media elements (the links) that are present in the received representation.Can everything in your API be done with one additional HTTP request after the home document? If yes, then sorry, I was assuming wrong. If no, does it not fail this test?The representation tells the client how to compose all transitions to the next application state.Anyways - RESTful or not - it works and it solves an important problem for us: handling multiple clients and multiple servers that do not evolve in lock step (and it does so by using hyper media among other things).
-MikeAs acknowledged.But if the guy who is building a web API using URL construction gets admonished for calling his api RESTful then is it not appropriate for all other deviations from REST be pointed out if people present their non-conforming APIs as RESTful? This is rest-discuss (and yes I know I am being a pedant at this time.)
- Once again you have given me much to ponder. Thanks for the effort; I will be trying to internalize this.
On May 4, 2013, at 1:49 PM, "Markus Lanthaler" <markus.lanthaler@...> wrote:
> On Saturday, May 04, 2013 7:03 PM, Mike Schinkel wrote:
>> Hmm. Okay, the more I think I understand about REST the more I think
>> I don't understand and/or am unsure who actually really understands
>> REST besides Roy.
>> As I've read Roy I've come away understanding that messages must be
> No, you are confusing self-contained with self-descriptive.
>> and the only thing the client should know is how the
>> links in the returned representation are defined to behave as defined
>> by the representation's content yype. Having links in one document and
>> data in a second document where you have to have the contents of both
>> documents seems to me to violate that need for self-containment.
> ... if there would be a self-containment constraint that would be true --
> but there isn't.
>> I do have one question; if there is a home document that is cacheable
>> for some period "X" and at the time immediately after an API client
>> retrieves the home document the servers are moved and the client later
>> perform an operation that requires URLs from the home document but
>> before "X" time has passed, it can cause failure. If the message is
>> self-contained that time window is greatly reduced. This is one of the
>> reasons I can postulate there is a need for self-contained messages.
> That doesn't matter at all. Program defensively, detect the error, and
> I could just as well argue that separating them allows you to request them
> in parallel which would probably be faster so the time window you are
> talking about would be reduced even further.
> Markus Lanthaler