HATEOAS

From IndieWeb

Hypermedia as the Engine of Application State (HATEOAS) is a constraint of the REST application architecture.

With HATEOAS, a REST client needs little to no prior knowledge about how to interact with an application or server beyond a generic understanding of the hypermedia presented.

Original Intent

  • This section is heavily influenced by htmx interpretation of hateoas*

Today the Wikipedia explanation of HATEOAS shows examples with JSON (due to today's trends) but the original intent was definitely closer to HTML.

Why HTML? Because a client (person) that loads a page can interpret the HTML presented as a GUI by the browser to him, with very little to no knowledge (or extra processing). We do not (in general) load and interact with JSON directly and frontends and backends have to agree on a schema and postprocess the JSON with JavaScript to generate an interface that can be interacted with.

For more about this interpretation check the htmx essays:

https://htmx.org/essays/hateoas/ https://htmx.org/essays/how-did-rest-come-to-mean-the-opposite-of-rest/

How does this relate to the indie web?

The indie web is the web of individuals, most of them do not have a big budget to create and update their site and most of them won't use those sites commercially. By using HTML as the Engine of Application State the complexity and amount of code needed to serve our website to other people will be dramatically reduced.

Microformats as CSS Hooks is an example of a simple way to enhance our Hypermedia (HTML) and use it to drive application state (such as informing that a new entry has been created) in a very simple way.

Another project that enhances HTML is https://htmx.org/, this tool allows you to write HTML that can execute JavaScript without you having to code it manually. It even allows lazy loading content with ajax provided that your backend serves partial HTML pieces to your frontend.