HATEOAS – Hypermedia as the Engine of Application State
When designing RESTful APIs, we often focus on resources, endpoints, and HTTP verbs — but we tend to overlook one of the most powerful ideas that REST was built upon: hypermedia. This is where HATEOAS (Hypermedia as the Engine of Application State) comes in.
At its core, HATEOAS means that a client interacts with an API** through hypermedia links provided dynamically by the server**, rather than relying on hardcoded URLs or prior knowledge of the API structure.
We simply embed enough information in our responses that the client can intelligently choose what action to take next using only the contents of the HTTP response.
— restfulapi.net/hateoas
Why HATEOAS?
Traditional REST APIs often look like this:
/api/orders
/api/orders/{id}
/api/orders/{id}/items
Clients must know these routes ahead of time. Any change to an endpoint, or the introduction of a new workflow, may break existing clients.
HATEOAS solves this problem by embedding links and relations directly in the server’s responses. This way, the client doesn’t need to know where to go next — the server tells it.
The goal, as described is to create REST services that are easier to understand, more self-descriptive, and more adaptable to change.
Read more on 4coders.onw.pl HATEOAS – Do we have standard?
Top comments (0)