What Is HATEOAS?
HATEOAS means Hypermedia As The Engine Of Application State.
It is part of REST's uniform-interface constraint. Instead of requiring clients to hard-code every possible transition, the server provides hypermedia controls that communicate available next actions.
For example, an order representation might contain links to itself, its customer, payment operation, cancellation operation, and shipment.
A truly hypermedia-driven client can discover available transitions from representations instead of depending entirely on undocumented URI conventions.
Hypermedia-Driven State Transitions
HATEOAS Representation
{
"id": "order_42",
"status": "pending",
"total": 1999,
"_links": {
"self": {
"href": "/orders/order_42"
},
"pay": {
"href": "/orders/order_42/payment",
"method": "POST"
},
"cancel": {
"href": "/orders/order_42/cancellation",
"method": "POST"
}
}
}💡 The representation exposes available transitions rather than forcing the client to construct every action URI itself.