News for hackers. Stuff that matters.
Re:When REST isn't Good Enough by pbreit on Tuesday November 20, 2012 @06:53PM (#4812001)
Not true.

GET /distance?cities=San+Francisco,Los+Angeles would suffice. city1=modesto&city2=fresno might be preferred if you wanted to support form submissions, too.

Query strings are perfectly restful.

Re:When REST isn't Good Enough by SilasX on Tuesday November 20, 2012 @07:34PM (#4812122)
That just shows it's HTTPful, not RESTful. In this case, that protocol involves being told how to construct a URI rather than it being presented from a menu of choices discovered by following URIs in the API.

I agree that it's much more convenient to have well-defined fill-in-the-blank. I disagree that it matches the requirements of REST, whose proponents always tell me "If you document the URIs or how to build them, you're doing it wrong."

http://stackoverflow.com/questions/1164154/is-that-rest-api-...

Re:When REST isn't Good Enough by bct on Tuesday November 20, 2012 @08:02PM (#4812215)
> involves being told how to construct a URI

The crucial thing that you're missing is that it's being told how to construct that URI in-band. Not in a piece of documentation that has to be hard-coded into the client.

Re:When REST isn't Good Enough by SilasX on Wednesday November 21, 2012 @02:58AM (#4813310)
So, once again, it turns out that REST reduces to RPC plus some advisable practices as soon as you point out how the original REST schema is woefully impractical.

Not-REST: You can algorithmically generate requests for the information you want based on documentation.

REST: You can algorithmically generate requests for the information you want based on documentation that's provided in the session. (Oh, and forget all that crap we said about URIs having to be presented to the API consumer as part of session's hyperlink navigation.)

So, now I can turn RPC into REST just by slapping a link to the documentation on every response (and maybe moving verbs to the appropriate HTTP request type, even though that has nothing to do with CRUD[1])? Gee, why didn't you say so?

[1] http://news.ycombinator.com/item?id=4811969

Re:When REST isn't Good Enough by bct on Wednesday November 21, 2012 @11:10AM (#4814760)
No.

You're not listening, and you're not arguing in good faith.

Re:When REST isn't Good Enough by SilasX on Wednesday November 21, 2012 @11:29AM (#4814875)
I could say the same of you. Please tell me how I failed to accurately characterize the difference between RPC and REST with respect to defining requests whose entire working URI set can't feasibly be sent over the network.

Alternatively, explain how REST can simultaneously meet the constraints of "avoid combinatorial explosion of possible URIs to explicitly present" and "every resource is accessible by following server-provided links" and "avoid unnecessary bandwidth usage".

Re:When REST isn't Good Enough by pbreit on Tuesday November 20, 2012 @10:57PM (#4812682)
If thats truly required (i dont think it is), the second example could be shown via introspection.