The Three Tenets of API Design (3/3): Respect REST

Concepts

Architectural Constraints

The Richardson Maturity Model

What Is HATEOAS?

GET /posts/1Link: </posts/1>; rel="self",
</posts/1/comments>; rel="comments"
{
"id": 1,
"title": "My blog post"
}

REST vs. the Rest

SOAP

<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:m="http://www.example.org/stock/Surya">
<soap:Header>
</soap:Header>
<soap:Body>
<m:GetStockPrice>
<m:StockName>IBM</m:StockName>
</m:GetStockPrice>
</soap:Body>
</soap:Envelope>

RPC

<?xml version="1.0"?>
<methodCall>
<methodName>users.getUserName</methodName>
<params>
<param>
<value><int>1</int></value>
</param>
</params>
</methodCall>
<?xml version="1.0"?>
<methodResponse>
<params>
<param>
<value><string>John Doe</string></value>
</param>
</params>
</methodResponse>

Technology leader and strategic advisor. I work at the intersection of people, software and words.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store