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
246
votes
8 answers

Orchestrating microservices

What is the standard pattern of orchestrating microservices? If a microservice only knows about its own domain, but there is a flow of data that requires that multiple services interact in some manner, what's the way to go about it? Let's say we…
Roger Johansson
  • 22,764
  • 18
  • 97
  • 193
49
votes
1 answer

How to create a good hypermedia format using JMSSerializerBundle?

Lets say I want to create an XML-response that will looks something like the following: 1234 Red Stapler
PatrikAkerstrand
  • 45,315
  • 11
  • 79
  • 94
47
votes
2 answers

what is hypermedia , hypermedia controls, hypermedia formats

I'm currently reading "Rest in practice" book . I'm unable to understand the following terminology Hypermedia , hypermedia format, hypermedia controls, Domain application protocol. The author was suggesting need for domain specific hypermedia…
vishnu
  • 511
  • 1
  • 7
  • 10
36
votes
3 answers

How to create a custom media type (application/vnd) for a RESTful web service?

I'm playing with REST right now and thought I properly implement HATEOAS just to get all concepts right. For that I want to create my own media types (application/vnd[...]+xml and application/vnd[...]+json). One first question: Does the media type…
JohnDoDo
  • 4,720
  • 8
  • 31
  • 47
25
votes
1 answer

Optionally disable HATEOAS format in Spring Data Rest

So let's say I have an existing application that has two endpoints /people and /pants. Calling GET /people returns: [ { "name":"john", "age":37, "pants":[ { "color":"green", …
Ben M
  • 1,833
  • 1
  • 15
  • 24
22
votes
4 answers

Generating Hypermedia links in a Web API

I'm curious to know how others have dealt with the issue of generating hypermedia links for their web APIs? Specifically, I'm using ASP.NET Web API, and am torn between having operations return hypermedia-related types, or returning the resource…
Jordan0Day
  • 1,386
  • 4
  • 15
  • 25
21
votes
2 answers

What is the importance of the self link in hypermedia APIs?

All the articles and books I read on REST repeat the importance of adding "self" rel links to your hypermedia responses but they're all light on the reasons and use cases. Why should you add a self link and how is it useful?
Ricardo Gladwell
  • 3,770
  • 4
  • 38
  • 59
20
votes
5 answers

JSON Hypermedia Api with forms and links

I am in the early stages of planning a REST api, and I would like for it to adhere to the HATEOAS constraint of REST. But I would also like to provide a JSON format. So my question is if there are conventions out there to represent links and forms…
Jay Pete
  • 4,123
  • 4
  • 35
  • 51
17
votes
2 answers

HATEOAS links with PUT/POST

What would be the best way to represent a HATEOAS link for a POST/PUT/PATCH on a resource? These operations have payload but we won't have an option to represent the payload in HATEOAS link as they aren't predetermined and can be heavy. So would it…
g0c00l.g33k
  • 2,458
  • 2
  • 31
  • 41
14
votes
1 answer

Include / embed vs. link in RESTful APIs

So the general pattern for a RESTful API is to return a single object with embedded links you can use to retrieve related objects. But sometimes for convenience you want to pull back a whole chunk of the object graph at once. For instance, let's say…
David Moles
  • 48,006
  • 27
  • 136
  • 235
12
votes
2 answers

How to expose the resourceId with Spring Data Rest

I had was to expose the primary key which is annotated with @Id in entity.the ID field is only visible on the resource path, but not on the JSON body.
Chandra
  • 1,722
  • 16
  • 19
11
votes
2 answers

Writing a client for a RESTful (hypermedia) API

I've been reading up on 'real' RESTful APIs for a few days now, and I think I'm near to groking what it's about. But one of the things that I stumble on is that I can't even begin to imagine how one would write a client for a 'real' hypermedia…
Benjol
  • 63,995
  • 54
  • 186
  • 268
10
votes
2 answers

How to access 'rel' from Links in header? Hypermedia link relations

I am using json server and axios result from header link: "; rel="first", ; rel="next", ; rel="last"" How can I use/access these data…
Þaw
  • 2,047
  • 4
  • 22
  • 39
10
votes
2 answers

HATEOAS and Microservices

I'm having some serious trouble seeing how HATEOAS and Microservices can co-exist. Let's take an example: Let's say we have a shopping cart resource. And we need to put snapshots of products into it, e.g. product Id, product price; snapshot of…
Roger Johansson
  • 22,764
  • 18
  • 97
  • 193
10
votes
1 answer

How to retrieve entity relationships after save?

I'm developing a RESTful webservice with spring-data as its data access layer, backed by JPA/Hibernate. It is very common to have relationships between domain entities. For example, imagine an entity Product which has a Category entity. Now, when…
miguelcobain
  • 4,734
  • 4
  • 32
  • 45
1
2 3 4 5 6 7 8