Wednesday, April 12, 2017


HATEOAS, an abbreviation for Hypermedia As The Engine Of Application State, is a constraint of the REST application architecture that distinguishes it from most other network application architectures. The principle is that a client interacts with a network application entirely through hypermedia provided dynamically by application servers. A REST client needs no prior knowledge about how to interact with any particular application or server beyond a generic understanding of hypermedia. By contrast, in some service-oriented architectures (SOA), clients and servers interact through a fixed interface shared through documentation or an interface description language (IDL).
The HATEOAS constraint decouples client and server in a way that allows the server functionality to evolve independently.

For example, [2] here is a GET request to fetch an Account resource, requesting details in an XML representation:
    GET /account/12345 HTTP/1.1
    Accept: application/xml
Here is the response:
    HTTP/1.1 200 OK
    Content-Type: application/xml
    Content-Length: ...

    <?xml version="1.0"?>
       <balance currency="usd">100.00</balance>
       <link rel="deposit" href="" />
       <link rel="withdraw" href="" /> 
       <link rel="transfer" href="" />
       <link rel="close" href="" />

In this example rel attribute is used to identify the link relationship

Different types of link

No comments:

Post a Comment