|
|
|
|
|
by superdude264
4414 days ago
|
|
I don't understand how it's possible to program to a true REST service given his final bullet point and one of his comments: > A REST API should be entered with no prior knowledge beyond the initial URI (bookmark) and set of standardized media types that are appropriate for the intended audience (i.e., expected to be understood by any client that might use the API). From that point on, all application state transitions must be driven by client selection of server-provided choices that are present in the received representations or implied by the user’s manipulation of those representations. The transitions may be determined (or limited by) the client’s knowledge of media types and resource communication mechanisms, both of which may be improved on-the-fly (e.g., code-on-demand). [Failure here implies that out-of-band information is driving interaction instead of hypertext.] > When I say hypertext, I mean the simultaneous presentation of information and controls such that the information becomes the affordance through which the user (or automaton) obtains choices and selects actions. [...] Hypertext does not need to be HTML on a browser. Machines can follow links when they understand the data format and relationship types. If you're only supposed to start with an initial URI and there is no out-of-band communication, how is an automaton supposed to know what links to follow to reach the desired information? A person can do this by reading, reasoning about what they read, then following the appropriate link. Writing an automaton that can reason about anything that can fall under the initial URI seems equivalent to writing some kind of artificial intelligence. |
|
> [a] set of standardized media types that are appropriate for the intended audience (i.e., expected to be understood by any client that might use the API)
There is out-of-band "communication" in that the client and server agree on these media types and how to use them.
The following article does the best job I've seen at illustrating a truly RESTful service:
http://www.infoq.com/articles/webber-rest-workflow
The <next> node in the response to the order POST is one such example.