httpresthyperlinkasp.net-web-apihateoas

HATEOAS Rel - Any Standards Yet?


I'm just starting to write a client implementation for a WebAPI I'm currently building. The API already employs HATEOAS so I'm writing the client accordingly. I'm using RestSharp as the base for the client.

The Client is passed the api base url at construction time ("https://myapi/start") which it fires a request at and is then passed a set of uris for other available resources - authorisation ( "https://myapi/authorize") and requesting access tokens ("https://myapi/tokens") to authorise it to call into secured resources on the api.

The question is are there any standards drawn up yet for the rel="" requirements in the returned hypermedia?


Solution

  • I believe Hypertext Application Language (HAL) is a draft standard - attempting to standardise these links between hypermedia.

    This is a link to the draft JSON specification https://datatracker.ietf.org/doc/html/draft-kelly-json-hal-03

    The HAL specification enforces the "href" conforms with the "Target IRI" defined in Web Linking specification (RFC 5988)

    There is an XML implementation of HAL using C# here https://github.com/tavis-software

    The same GitHub repository above also contains an example .Net implementation of RFC 5988.