Notes: Hypermedia
Notes from https://hypermedia.systems/
Hypermedia api vs data api
One describes intent, behaviour, while the other just describes resources. It's ok to have both.
With a hypermedia api, the client is completely dumb, a browser (hypermedia client) only understands HTML hypermedia, it has no concept of what that hypermedia is doing, it has no idea what potential actions you can take at a certain point in time, it's the hypermedia that describes all of that, the data you are allowed to see, the actions you are allowed to take.
With a data api the client has no choice but to be smart, it has to know that based on this data it should only render this information, or based on this other shape, it should not show these buttons, or show a different view. The client is tightly coupled to the data api, therefore when the data api changes the client also has to change, or coordinate somehow with flags, version numbers etc.
HTTP is just a way of transferring hypermedia, works quite well with HTML hypermedia.
HTML only has 2 ways to natively interact over HTTP, GET (links, form) and POST (form).
It is possible to augment other requests over POST via hidden field conventions such as _method="PATCH" within a form, however ideally HTML would enhance itself to achieve this natively by allowing forms or links to PUT, PATCH and DELETE.
The triggers HTML has built in to talk HTTP are only click events on links, or submit events on forms, ideally this would be enhanced to allow all kinds of triggers such as keyup, hover, etc.