To install click the Add extension button. That's it.

The source code for the WIKI 2 extension is being checked by specialists of the Mozilla Foundation, Google, and Apple. You could also do it yourself at any point in time.

4,5
Kelly Slayton
Congratulations on this excellent venture… what a great idea!
Alexander Grigorievskiy
I use WIKI 2 every day and almost forgot how the original Wikipedia looks like.
Live Statistics
English Articles
Improved in 24 Hours
Added in 24 Hours
What we do. Every page goes through several hundred of perfecting techniques; in live mode. Quite the same Wikipedia. Just better.
.
Leo
Newton
Brights
Milds

From Wikipedia, the free encyclopedia

Hypermedia as the engine of application state (HATEOAS) is a constraint of the REST application architecture that distinguishes it from other network application architectures.

With HATEOAS, a client interacts with a network application whose application servers provide information dynamically through hypermedia. A REST client needs little to no prior knowledge about how to interact with an application or server beyond a generic understanding of hypermedia.

By contrast, clients and servers in Common Object Request Broker Architecture (CORBA) interact through a fixed interface shared through documentation or an interface description language (IDL).

The restrictions imposed by HATEOAS decouple client and server. This enables server functionality to evolve independently.

The term was coined in 2000 by Roy Fielding in his doctoral dissertation.[1]

YouTube Encyclopedic

  • 1/3
    Views:
    384 314
    16 937
    15 551
  • REST Web Services 08 - HATEOAS
  • REST API - Understanding HATEOAS
  • Software Design - REST API - What is HATEOAS?

Transcription

Example

A user-agent makes an HTTP request to a REST API through an entry point URL. All subsequent requests the user-agent may make are discovered inside the response to each request. The media types used for these representations, and the link relations they may contain, are part of the API. The client transitions through application states by selecting from the links within a representation or by manipulating the representation in other ways afforded by its media type. In this way, RESTful interaction is driven by hypermedia, rather than out-of-band information.[2]

For example, this GET request fetches an account resource, requesting details in a JSON representation:[3]

GET /accounts/12345 HTTP/1.1
Host: bank.example.com

The response is:

HTTP/1.1 200 OK

{
    "account": {
        "account_number": 12345,
        "balance": {
            "currency": "usd",
            "value": 100.00
        },
        "links": {
            "deposits": "/accounts/12345/deposits",
            "withdrawals": "/accounts/12345/withdrawals",
            "transfers": "/accounts/12345/transfers",
            "close-requests": "/accounts/12345/close-requests"
        }
    }
}

The response contains these possible follow-up links: POST a deposit, withdrawal, transfer, or close request (to close the account).

As an example, later, after the account has been overdrawn, there is a different set of available links, because the account is overdrawn.

HTTP/1.1 200 OK

{
    "account": {
        "account_number": 12345,
        "balance": {
            "currency": "usd",
            "value": -25.00
        },
        "links": {
            "deposits": "/accounts/12345/deposits"
        }
    }
}

Now only one link is available: to deposit more money (by POSTing to deposits). In its current state, the other links are not available. Hence the term Engine of Application State. What actions are possible varies as the state of the resource varies.

A client does not need to understand every media type and communication mechanism offered by the server. The ability to understand new media types may be acquired at run-time through "code-on-demand" provided to the client by the server.[1]

Origins

The HATEOAS constraint is an essential part of the "uniform interface" feature of REST, as defined in Roy Fielding's doctoral dissertation.[1] Fielding has further described the concept on his blog.[2]

The purpose of some of the strictness of this and other REST constraints, Fielding explains, is "software design on the scale of decades: every detail is intended to promote software longevity and independent evolution. Many of the constraints are directly opposed to short-term efficiency. Unfortunately, people are fairly good at short-term design, and usually awful at long-term design".[2]

Implementations

  • HTML itself is hypermedia, with the <form>...</form> element in control of HTTP requests to links.[2][4]
  • HAL, hypermedia built on top of JSON or XML. Defines links, but not actions (HTTP requests).
  • JSON-LD, standard for hyperlinks in JSON. Does not address actions.
  • Siren, hypermedia built on top of JSON. Defines links and actions.[5]
  • Collection+JSON, hypermedia built on top of JSON. Defines links and actions.[6]
  • JSON:API, defines links and actions.[7]
  • Hydra. Builds on top of JSON-LD to add definition of actions.[8]

See also

References

  1. ^ a b c Fielding, Roy Thomas (2000). "Representational State Transfer (REST)". Architectural Styles and the Design of Network-based Software Architectures (PhD). University of California, Irvine. p. 82. ISBN 0599871180.
  2. ^ a b c d Fielding, Roy T. (20 Oct 2008). "REST APIs must be hypertext-driven". Retrieved 20 May 2010.
  3. ^ Thijssen, Joshua (2016-10-29). "What is HATEOAS and why is it important for my REST API?". REST CookBook. Retrieved 2020-02-05.
  4. ^ Gross, Carson. "HATEOAS". htmx.org. This, despite the fact that neither XML nor JSON was a natural hypermedia in the same manner as HTML.
  5. ^ Siren: a hypermedia specification for representing entities on GitHub
  6. ^ "Collection+JSON - Hypermedia Type". Retrieved 2021-10-25.
  7. ^ "JSON API: Latest Specification". Retrieved 2021-10-25.
  8. ^ "Hydra: Hypermedia-Driven Web APIs". Retrieved 2021-10-27.
This page was last edited on 8 January 2024, at 00:08
Basis of this page is in Wikipedia. Text is available under the CC BY-SA 3.0 Unported License. Non-text media are available under their specified licenses. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc. WIKI 2 is an independent company and has no affiliation with Wikimedia Foundation.