Displaying with interaction

Once the across-the-wire representation (application/json) arrives, the API browser (in pretty print mode) creates an improved, human readable and interactable display. In short, URIs are made clickable, and and button are added to link relations are.

The purpose of this part of the tutorial isn’t to explain the HTML markup per se (you can look at the implementation and usage of third-party libraries). Rather it is to demonstrate how hypermedia makes it possible to have a generalised client.

The basic additions

Additions to link relations are:

  1. self has a delete button (to perform DELETE)
  2. create-form loads up the a create form for values to be entered (to perform a POST)
  3. edit-form loads up the an edit form and includes the current representation values to be changed (to perform a PUT)
  4. edit-form with a media type text/uri-list creates a drop target via HTML5 of a URI or uri-list (to perform a PUT of media type text/uri-list)
  5. edit-form with a media type application/json-patch+json creates a drop target via HTML5 of a URI or uri-list (to perform a PATCH of media type application/json-patch+json)

links

Unlock the next chapter
A generalised client is all about
Avoiding having to write HTML to work with customers
Make the domain easily accessible early on for the team
Because it is the only way to do hypermedia
None of the above