5. Possible solution
“WWW is fundamentally a distributed
hypermedia application.” Richard Taylor
And the application works!
6. How WEB works
Browsers know how to:
● deal with media types (text/html,
image/png...)
● navigate via links and submit forms
7. How WEB works
Browsers know how to:
● deal with media types (text/html,
image/png...)
● navigate via links and submit forms
Let’s follow the example!!!
8. Example -- eBay API
GET .../item/180881974947
{
"name" : "Monty Python and the Holy Grail white rabbit big pointy teeth",
"id" : "180881974947",
...
"links" : [
{ “type: "application/vnd.ebay.item",
"rel": "Add item to watchlist",
"href": "https://.../user/12345678/watchlist/180881974947"},
{ // and a whole lot of other operations ]}
Source: http://www.slideshare.net/josdirksen/rest-from-get-to-hateoas
24. XHTML as a base format
● Native support for links and forms
● Ubiquitous client (browser)
● XHTML is XML
● HAML :)
25. Extending vs versioning
Reasons for a new version:
● A change that alters the meaning or
functionality of an existing feature or
element
● A change that causes an existing element to
disappear or become disallowed
● A change that converts an optional element
into a required element
30. Rails and HATEOAS
● lack of abstractions for hypermedia controls
● confusing terms:
○ #resource are two different resources
31. Rails and HATEOAS
● lack of abstractions for hypermedia controls
● confusing terms:
○ #resource are three different resources
● OPTIONS verb
32. Rails and HATEOAS
● lack of abstractions for hypermedia controls
● confusing terms:
○ #resource are three different resources
● OPTIONS verb
● PATCH verb
33. Rails and HATEOAS
● lack of abstractions for hypermedia controls
● confusing terms:
○ #resource are three different resources
● OPTIONS verb
● PATCH verb
● PUT verb
○ upsert
○ whole resource state
34. Rails and HATEOAS
● lack of abstractions for hypermedia controls
● confusing terms:
○ #resource are three different resources
● OPTIONS verb
● PATCH verb
● PUT verb
○ upsert
○ whole resource state
● custom media types require custom code