Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In the above resource object, there are three relations defined: self, collection, and openOrders. Each relation then includes an href sub-property with a URI value to the URI that allows the client to request that resource.

In the HAL specification draft, there SHOULD always be a self relation. This references the current resource object, as per the Web Linking RFC. Other relations can be defined by the server and developer as needed assuming they are meaningful to the resource. All relation names should be immutable. That is, once a relation name has been defined, clients should assume it will never change. The URI that a relation points to can change in order to maintain the decoupled and client/server independent intent of HATEOAS. Relations can be deprecated.

These link relations are designed to be simple. Clients should be able to use the OPTIONS HTTP method to get a list of all supported HTTP methods via the Allow response header. The SRP HTTP Framework handles this automatically.