tags:

views:

1277

answers:

4

Hi,

as everyone may have noticed, there are lot of fake/rudimentary REST-APIs in the wild (which implement a HTTP-API and call it REST without following the hypertext-as-the-engine-of-application-state requirement, which led to the famous rant of Roy T. Fielding, the man who first specified the REST-paradigm).

I've been unable to find any practical examples of a truly hypertext driven REST-implementation along with the associated application-specific media-type definitions for the state transitions.

Are there any publicly accessible examples of such implementations?

+5  A: 

Its not an implementation in the sense of running code, but I really like the article "How to GET a cup of coffee" on InfoQ. It describes the process of ordering a coffee at Starbucks as a RESTful protocol. This goes beyond the typical "everything is a resource" REST introductory article and focuses on HATEOAS. Highly recommended.

trendels
This is a fantastic article.
Wahnfrieden
+1  A: 

AtomPub?

Wahnfrieden
+4  A: 

How about the Sun Cloud API? From the introduction:

The API presupposes no particular structure in the URI space. The starting point is a URI, supplied by the cloud service provider, which identifies the cloud itself. The cloud's representation contains URIs for the other resources in the cloud, and also for operations which may be performed upon them (for example deploying and starting virtual machines).

The backstory might also be helpful.

Rich Apodaca
+1  A: 

Isn't the RESTfulness of Sun Cloud API actually addressed in Roy's 4th point:

A REST API must not define fixed resource names or hierarchies (an obvious coupling of client and server). Servers must have the freedom to control their own namespace. Instead, allow servers to instruct clients on how to construct appropriate URIs, such as is done in HTML forms and URI templates, by defining those instructions within media types and link relations. [Failure here implies that clients are assuming a resource structure due to out-of band information, such as a domain-specific standard, which is the data-oriented equivalent to RPC's functional coupling].

Example 1 Fixed resource names in a defined heirachy:

From the Sun Cloud API: "... the representation of a VDC will include representations of the Clusters which inhabit it, which in turn include representations of the VMs within each cluster."

Example 2 out-of-band information, such as a domain-specific standard:

You have to have the wiki-page contents (out-of-band information) to know that the "resource communication mechanism" for the Cloud resource field "uri" is GET.

Hedgehog
You are correct, that is very misleading. However, Roy is talking about resource names in the uri space, not within the contents of the media type. Sun is free to change the uri that is used to access a cluster at any time. Obviously, it can't change the term "cluster" to "group" inside the representation without creating a new version of the media type, but it can change the URI to be anything.
Darrel Miller
We know that the Sun API uses HTTP as its uniform interface, so the client does not need to look at the wiki-page to know that GET is a valid verb for the cloud resource. It can either just try it considering it knows that GET is a safe verb, or it can use OPTIONS to determine if it is available.
Darrel Miller