3 ms·
This article seems to just be describing plain-old HTML. You make a request to a URL, get back HTML, render the HTML. The HTML has forms and links that you clic
by Osiris 5y ago
This article seems to just be describing plain-old HTML. You make a request to a URL, get back HTML, render the HTML. The HTML has forms and links that you click and get back new HTML.
I don't see how this is an API at all. It's just (server-side rendered) HTML.
- dragonwriter 5y agoREST, including the principle of HATEOAS, is an architectural style derived as a generalization/rationalization of the early web design and explicitly underlying HTTP 1.1, so an explanation of HATEOAS looking like a normal use of HTML on the web is not at all surprising. The Web itself is a distributed hypermedia API.
- BlackFly 5y agoIt is an API that you program against when you want to build a client for that API. That client is a browser, the most famous of which are Chrome, Firefox, Safari, Edge, Opera, etc. The HATEOAS constraint is what allows the actual form of (for example) a webshop's checkout to start asking for additional details from one day to the next without me needing to update the client. The Hypermedia is indeed HTML, images, movies, javascript, style files, etc. HTML contains the embedded links to navigate around a webshop, the form controls tell the browser what it needs to POST to a url (and that it needs to POST or PATCH). To do something like that with a data API, the form the data must be comprehensible a priori and the client must be able to know the form of the data dynmically. This means either a large (or small like the web) registry of types of data that you are limited, or some sort of link + schema that the client can understand. If you build such an API, and I build a client, then my client will also naturally work on anyone else's web application that follows the same constraint. That is, my client will be universal. It turns out that nobody web browsers really want or need a universal client. If you want to see an example of what that looks like in practice, check out JSON-LD at https://json-ld.org/spec/latest/json-ld/ https://json-ld.org/spec/latest/json-ld/ or other specs like it.
- brabel 5y ago> I don't see how this is an API at all. That's absolutely an API... perhaps what you think of as an API is too narrow in scope?
- recursivedoubts 5y agoA server returning HMTL is an API. It is a hypermedia API, which is what the terms HATEOAS and REST originally came out of. Which is why those concepts have had such a bumpy ride when ported over to JSON APIs.
- deleted 5y ago[deleted]