liveBook · Manning

Hypermedia

As explained in Spring in Action, Sixth Edition

HATEOAS is a REST constraint in which hypermedia controls guide a client through an application's available resources and state transitions.

Hypermedia, expressed through HATEOAS, lets an API guide clients with hyperlinks. Instead of constructing every URL, a client selects named links to navigate resources and state transitions. section 7.2

Following ingredient links

A GET request to /ingredients can return an ingredient collection with self, ingredient, and profile links. A client can follow the ingredient link to request /ingredients/FLTO without hard-coding that resource URL. section 7.2

Hypermedia reduces client knowledge of API structure, but links add payload data and require clients to understand link-based navigation. Spring Data REST adds them automatically; Spring HATEOAS supports adding them in MVC responses. section 7.2

How Spring in Action, Sixth Edition covers it

How deep it goes
Explains link-based navigation, generated responses, and tradeoffs, then stops short of implementing custom hypermedia APIs.
Examples
Uses curl responses for ingredient collections and individual ingredients containing self, ingredient, and profile links.
What it assumes
Assumes basic HTTP API requests and teaches HATEOAS navigation through concrete resource responses.
What you can do after
Apply it via Spring Data REST by consuming generated hyperlinks as navigation targets for subsequent API requests.
How it connects
Connects HATEOAS with REST APIs, Spring Data REST, Spring HATEOAS, and Spring MVC controllers.

Also explained in

Compare how 3 books explain hypermedia →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Spring in Action, Sixth Edition. The section links point to the parts of the book it draws on.