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
5
votes
1 answer

Spring HATEOAS with Traverson

I'm using spring-hateoas:0.18.0.RELEASE with spring-boot:1.2.5.RELEASE For calling my Web Service and going through HAL links i'm using Traverson Client (API for client side service traversal inspired by the Traverson JavaScript library) Spring…
Ivan Aracki
  • 4,861
  • 11
  • 59
  • 73
5
votes
1 answer

URL handling in a Hypermedia (HATEOAS) driven AngularJS application

We are looking for some advice on handling URLs (and the state related to each URL) in a web application backed by a HATEOAS REST API, more specifically on how to avoid having the web application URLs coupled with the REST API URLs how to handle…
Luc Feys
  • 127
  • 1
  • 9
5
votes
3 answers

How do you represent "thin" and "fat" versions of a RESTful resource?

How would you model a resource that can have two different representations. For example, one representation may be "thin" withe most of its related resources accessible by links. Another representation may be "fat" where most of its related…
SingleShot
  • 18,821
  • 13
  • 71
  • 101
5
votes
2 answers

Working with a Hypermedia (REST) API in Backbone

In the process of building a Backbone.js SPA that talks to a RESTful (hopefully) API. I've tried to design the API around resources, using hypermedia to link the resources together. As I've begun implementing things in Backbone, I'm starting to…
Jon Wingfield
  • 1,875
  • 2
  • 11
  • 8
4
votes
1 answer

How to get a response in HAL-Format with Spring-Hateoas

Basically i have the same issue like the member who posted this question When i request a single user in my Application, i get the response in the HAL-format, like i wish http://localhost:8080/api/v1/users/25 with GET: { "userId": "25", "firstname":…
Beytullah Güneyli
  • 518
  • 2
  • 8
  • 21
4
votes
0 answers

How to include selfLink and navigationLink in ASP.NET Web API 2 OData v4 responses?

I would like to include the selfLink and navigationLink(s) in my JSON responses like this: { "@odata.count": 4, "@odata.nextLink": http://example.com/v1.0/Entity?$top=2&$skip=2", "value": [ { "@odata.selfLink":…
carens
  • 309
  • 3
  • 14
4
votes
1 answer

AngularJS with Hypermedia (HATEOAS): how to use hypermedia urls accross states

I have an AngularJS application with ui router that consumes a REST API with Hypermedia. The general idea is to have the API generate the urls for its various calls, and keep the client from constructing the urls itself. For example, when fetching…
fikkatra
  • 5,605
  • 4
  • 40
  • 66
4
votes
1 answer

HAL, JSONAPI, Collection+json, odata other hypermedia pro and cons

There is so many hypermedia available fora restful api. I am not sure which one is suitable for which case. It is my first attempt for restful api so I cant foresee problem and advantage of using it. What I want is which can be queried and also with…
varuog
  • 3,031
  • 5
  • 28
  • 56
4
votes
4 answers

How to construct intersection in REST Hypermedia API?

This question is language independent. Let's not worry about frameworks or implementation, let's just say everything can be implemented and let's look at REST API in an abstract way. In other words: I'm building a framework right now and I didn't…
Jan Święcki
  • 1,611
  • 2
  • 16
  • 28
4
votes
1 answer

REST - can clients cache links to resources?

Let's say you've got a fully hypermedia driven API. Consumers have to navigate three reources, via following hypermedia, until they can get to the resource they want. Is there any reason a client could not cache these steps temporarily and go…
user2668128
  • 39,482
  • 8
  • 27
  • 34
4
votes
1 answer

Hypermedia API for native clients (android, iOS)?

Do you think it is a good idea to expose hypermedia api (HATEOAS) for native clients (android, iOS)? What are the difficulties when the clients try to consume such an API? I assume that the UI will be driven by the responses form the API. I have…
mynkow
  • 4,408
  • 4
  • 38
  • 65
4
votes
1 answer

Links (relations) to REST resources in AngularJS

I have a REST API, which returns User object, where its roles are specified via link to another object. So at localhost/project/api/users/27/ is JSON object: { "id": 42, "name": "John", "prijmeni": "Doe", "login": "johndoe", …
PhoenixS
  • 1,016
  • 1
  • 9
  • 23
4
votes
2 answers

Hypermedia API Link Traversal & Practicality

I've been trying to build a hypermedia based API. Things seem working well. Say when I fetch /books/isbn/12313441213 I get something like this: 123 Hypermedia APIs Basic api design…
James Dolnewiy
  • 103
  • 1
  • 4
4
votes
0 answers

Is it correct that Jersey does not support declarative hyperlinking in nested resources?

public class Widget { @Ref(resource=WidgetResource.class) URI url; ... public URI getUrl() { return url; } public Wonkle getWonkle() { return wonkle; } } public class Wonkle { …
cmac
  • 191
  • 2
  • 4
4
votes
1 answer

Implementing hypermedia-driven API with Grape (or Sinatra)

I'm trying to implement a hypermedia-driven API using Grape mounted directly on top of Rack. Grape supports presenters ("entities") which seem to be the proper place for providing all related hypermedia. If I had Rails router available, I could…