HATEOAS API: Difference between revisions

From Delft Solutions
Jump to navigation Jump to search
No edit summary
No edit summary
Line 5: Line 5:
* It does not allow clients to construct [[URL | URLs]] (unless [[URL Templating | instructed by the server to do so]]) to allow for applications to change their URL structure.
* It does not allow clients to construct [[URL | URLs]] (unless [[URL Templating | instructed by the server to do so]]) to allow for applications to change their URL structure.
* Other than an entry URL and a set of documents describing the [[Media Types]], no additional knowledge should be necessary to use the API.
* Other than an entry URL and a set of documents describing the [[Media Types]], no additional knowledge should be necessary to use the API.
* Having a nice URL structure is not essential, people in browsers will be clicking on links instead of typing and source code should only contain the root URL.


HATEOAS APIs usually make heavy use of HTTP features like:
HATEOAS APIs usually make heavy use of HTTP features like:
Line 39: Line 40:
|-
|-
| [https://github.com/microsoft/api-guidelines/blob/vNext/Guidelines.md Microsoft] || style="background:#caffbf"|Yes || style="background:#caffbf"|Yes || style="background:#caffbf"|Yes || style="background:#caffbf"|Yes || style="background:#ffadad"|No || style="background:#ffadad"|No || style="background:#caffbf"|Yes || style="background:#caffbf"|Yes
| [https://github.com/microsoft/api-guidelines/blob/vNext/Guidelines.md Microsoft] || style="background:#caffbf"|Yes || style="background:#caffbf"|Yes || style="background:#caffbf"|Yes || style="background:#caffbf"|Yes || style="background:#ffadad"|No || style="background:#ffadad"|No || style="background:#caffbf"|Yes || style="background:#caffbf"|Yes
|-
| [https://cloud.google.com/apis/design Google] || style="background:#caffbf"|Yes || style="background:#caffbf"|Yes || style="background:#ffadad"|No || style="background:#caffbf"|Yes || style="background:#ffadad"|No || style="background:#ffadad"|No || style="background:#caffbf"|Yes || style="background:#caffbf"|Yes
|}
|}


[[Category: Terminology]]
[[Category: Terminology]]

Revision as of 18:44, 18 January 2021

Originally called REST, HATEOAS is a way of designing HTTP APIs as described in Roy Fieldings thesis. The acronym stands for Hypermedia as the Engine of Application State.

It distinguishes itself from other APIs by having the following properties:

  • Heavy use of Media Types to allow Backward Compatibility.
  • It does not allow clients to construct URLs (unless instructed by the server to do so) to allow for applications to change their URL structure.
  • Other than an entry URL and a set of documents describing the Media Types, no additional knowledge should be necessary to use the API.
  • Having a nice URL structure is not essential, people in browsers will be clicking on links instead of typing and source code should only contain the root URL.

HATEOAS APIs usually make heavy use of HTTP features like:

Comparison

Method Browser Accessible Backward Compatible Backward Compatible (default) HTTP Cachable No URL Construction URL as Identifier Stable Pagination Concurrency Support
HATEOAS ? Yes ? Yes Yes Yes ? Yes
media_types-serialization (HATEOAS) Yes Yes Yes Yes Yes Yes Yes ?
Github (REST) Yes Yes No No Yes Yes Yes No
Zalando No Yes Yes No No Yes Yes Yes
Facebook Graph API Yes Yes Yes No No No ? No
Shopify (REST) Yes Yes Yes No No No Yes No
GraphQL No Yes No No Yes No Yes No
Microsoft Yes Yes Yes Yes No No Yes Yes
Google Yes Yes No Yes No No Yes Yes