simultaneous presentation of information and controls such that the information becomes the affordance through which the user obtains choices and selects actions” (Fielding, 2008) Hypermedia API ≈ strict REST API
Model state on client and server Hypermedia as affordances Hypermedia as affordances Links to other resources Forms to describe available actions on resources Verbs to transfer Verbs to transfer Synchronise state between client and server Apply changes to both
URI as cache key Verb semantics: GET is safe & idempotent 2 Layer standard HTTP components Layer standard HTTP components CDN, proxy, server, etc. Control caching from the server Control caching from the server Headers: Cache-Control, Vary, E-Tag, etc. Transparently respected downstream
forms self-documenting (in-band) 1 3 Web-like Web-like Browse API from the root or any resource Submit forms while exploring in browser Resource address returns its data
config Extensible Extensible Add data properties Add links & form fields Ignored if unsupported Server configures clients Server configures clients Only config is API root No URL construction Change link targets transparently 1 3 Composeable Composeable Add new services via links and forms Shared media-type helps Avoids monolithic library
Visibility Visibility Send URL around Server request logs Browser network panel Wireshark Scalable Scalable cURL Bookmarklets Apple Scripts Small web clients Mobile apps Large single-page apps 0 3 1 2
the UI Based on permissions, business logic Avoids hardcoding rules in both server & client Server rules can change, apply to all clients if valid, expose link if invalid, omit link Requirement: can only crop valid images Links & forms as affordances 3
in form fields Apply to HTML UI form Avoids hardcoding rules in both server & client R&D e.g. required, min/max length, “email”, etc Authoritative Authoritative
Argo+JSON: 37.4KB +40% gzipped 4.4KB 5.1KB +15% No data schema No data schema Versioning Versioning State transfer model State transfer model Avoid side-effects Poll, no PUSH Weak tooling Weak tooling
performance Simple to integrate and debug Resources model state Resources model state Verbs transfer state Verbs transfer state Hypermedia controls as affordances Hypermedia controls as affordances Discoverable for developers Dynamic link structure allows evolveability Authoritative source of client actions through forms