Questions tagged [hypermedia]

Hypermedia is a technique for working with and on data between a client and a server. It is used in both machine-to-machine and machine-to-human scenarios. It's main feature is the mixing of data and controls in a single message with no out-of-bounds data. The most known hypermedia is HTML but there exist many other hypermedia formats.

The concept of "mixing data and controls" is hypermedia's main distinguishing feature.

This means that both the data the user requested is being send, but also a description on the available operations and how to do further interactions with a server. The data could be a description of a person, an article or an invoice and the controls could be a description on how to change the address of the person, how to publish the article and how to send a credit note for the invoice.

HTML does this through forms and links. Links may be represented with for example link, a or img tags.

See also

Other Hypermedia Formats

120 questions
3
votes
1 answer

Implementing REST hypermedia using WCF

I have a WCF-based REST service and I'm planning to add hypermedia support to it. Currently I'm relying on WCF to build the service response by serializing my data contracts. With hypermedia in the picture now, I need a way to instruct WCF to insert…
G S
  • 35,511
  • 22
  • 84
  • 118
3
votes
1 answer

Does the API Platform framework fully support HATEOAS?

Currently I am working on a REST API and noticed, that for real REST it is essential to provide the possible HTTP operations of the resource within the HTTP response (e.g. in JSON-LD format). After playing around with Swagger, I got to JSON-LD and…
Chris
  • 2,071
  • 4
  • 14
  • 22
3
votes
2 answers

Hypermedia API: How to document properly?

I am in the middle of developing my first Hypermedia API. I thought I had a good grasp of things but when It comes to documenting the API, I start to question my understanding of the whole concept. The core of the question comes down to documention,…
Malax
  • 9,436
  • 9
  • 48
  • 64
3
votes
2 answers

How to deal with per verb permission in Rest on a client?

Lets assume we have a resource on an URL like so: foo.com/api/bar And lets say that a user might be allowed to GET that resource, but not allowed to POST to that resource. I can easily solve that by specifying different permissions per verb. But how…
Roger Johansson
  • 22,764
  • 18
  • 97
  • 193
3
votes
2 answers

How to present resource id to client?

org.springframework.hateoas.ResourceSupport already contains a getId method. In case my resource (or better domain object) contains an integer id which needs to be presented to the client I cannot add a simple id and add getId/setId (as…
Marcel Overdijk
  • 11,041
  • 17
  • 71
  • 110
3
votes
2 answers

Master-detail representation in Json-LD

On forhand : sorry if I misunderstood hypermedia or Restfull concepts : it's a work in progress...) I try to figure out hypermedia and hydra (http://www.markus-lanthaler.com/hydra), and have some questions about returning information to the client…
Cedric Dumont
  • 1,009
  • 17
  • 38
3
votes
2 answers

Using Hypermedia Constraint API to drive UI

I want to use a REST API with hypermedia constraint to drive my UI. That is, depending on "possible next states" for the resources I fetch, I want to adapt my UI for this. I'm quite new to UI dev on the web so I wonder if there is any special…
Roger Johansson
  • 22,764
  • 18
  • 97
  • 193
3
votes
2 answers

REST Hypermedia API - Navigating from Stateless Client

A straightforward question: if I am building a stateless client, which 'changes page' between requests, how do I properly consume a hypermedia API? A key point of course is that the client should not construct URLs. If we were to for example fetch a…
jstephenson
  • 2,170
  • 14
  • 14
3
votes
1 answer

ServiceStack custom format and vendor specific content types

I am trying to add a custom format for HAL (hypertext application language). I have my custom format handler created, I followed along with the ServiceStack v-card example, and all is working fine there and I was able to register it with…
officert
  • 1,232
  • 9
  • 12
2
votes
1 answer

Hypermedia (ReST) SOA: Good design for consistent service-level authentication?

I'm currently developing an SOA solution, where each service in the architecture is a secure, authenticating hypermedia resource (as in really hypermedia, not RPC with pretty URLs). Customer-facing, company-internal and customer-built applications…
2
votes
1 answer

Hypertext Forms - ETag in the hypermedia control

Consider that I'm using HTML for my REST API media-type, it could be JSON it doesn't matter. HTML has a well understood
element with an action and a method. But if I'm posting to a resource location and I want to defend against concurrent…
Luke Puplett
  • 42,091
  • 47
  • 181
  • 266
2
votes
1 answer

REST - Typed resources vs HYDRA classes

From Fielding's article (https://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven): A REST API should never have “typed” resources that are significant to the client. Specification authors may use resource types for describing server…
David Szalai
  • 2,363
  • 28
  • 47
2
votes
1 answer

How do I get a custom hyperlinked field to include extra url variable and work for all ModelViewSets?

I use a variable in the base of my API url, identical to the setup found in the docs for Django REST Framework: /api//states// Everything after the base brand slug is a standard API format, and so I use ModelViewSets to generate…
rgilligan
  • 754
  • 5
  • 18
2
votes
0 answers

RAML API Designer Mock Service: HATEOAS response with absolute URLs?

I created REST API mock using RAML tool. How can I return in my JSON object response hypermedia links with absolute paths? Is there a way to include baseUri into my sample JSON object in order to create absolute path? Right now I have relative path…
Saša
  • 653
  • 1
  • 5
  • 17
2
votes
1 answer

Get a collection of sub-resources at once with JSON-LD and Hydra

In the RESTful Web API book, the authors advise to expose a profile and use a content type which acknowledges link relations. JSON-LD extended by Hydra seem to match these requirements, and I want to use them in the design of my new API. I am…