Hypermedia: Difference between revisions
No edit summary |
No edit summary |
||
Line 14: | Line 14: | ||
</blockquote> | </blockquote> | ||
Using hypermedia responses, [[Link|links]] in the response can indicate a set of next actions, as well as point to documentation or related endpoints. This allows for discoverable APIs<ref>[https://sookocheff.com/post/api/on-choosing-a-hypermedia-format/ Article: On choosing a hypermedia type for your API - HAL, JSON-LD, Collection+JSON, SIREN, Oh My!]</ref>. | Using hypermedia responses, [[Link Header|links]] in the response can indicate a set of next actions, as well as point to documentation or related endpoints. This allows for discoverable APIs<ref>[https://sookocheff.com/post/api/on-choosing-a-hypermedia-format/ Article: On choosing a hypermedia type for your API - HAL, JSON-LD, Collection+JSON, SIREN, Oh My!]</ref>. | ||
== Examples == | == Examples == |
Latest revision as of 17:41, 15 January 2021
Hypermedia is a form of media (things like text, images, video) that has things you can click on / interact with to navigate to other pages.
An early example of hypermedia is the Aspen Movie Map which allowed you to travel to a building by clicking on it. On its own this idea is useful but with the introduction of URLs you gain the ability to combine multiple hypermedia into one bigger hypermedia. A good example of this is this wiki page: it has its own URL which allows other hypermedia to link to it and at the same time it links to other webpages using their URL. This results in a bigger hypermedia called the World Wide Web.
A precise definition of hypermedia is: a nonlinear medium of information that includes graphics, audio, video, plain text and hyperlinks.[1].
Hypermedia in JSON API Design
An advantage of modeling API responses as hypermedia is that it allows clients to organically discover new parts of the API by using the embedded links.
JSON has no built-in support for hyperlinks, which are a fundamental building block on the Web.
— W3C[2]
Using hypermedia responses, links in the response can indicate a set of next actions, as well as point to documentation or related endpoints. This allows for discoverable APIs[3].
Examples
- The World Wide Web
- This wiki