4

this is my first post here, so be nice please.

I'm actually learning RESTEasy (JBoss), and I'm having some trouble of understanding the utility of putting atom links in my web responses.

Let me clarify some things :

I'm reading the jboss RESTEasy reference manual, and I quote :

There are two mechanisms available in RESTEasy to link a resource to another, and to link resources to operations: the Link HTTP header, and Atom links inside the resource representations.

I don't get what linking one resource to another means. What the point of doing that ? What benefits it offers ?

source : http://docs.jboss.org/resteasy/docs/2.3.1.GA/userguide/html/LinkHeader.html

Dan Lowe
  • 51,713
  • 20
  • 123
  • 112
Jean-Michel Garcia
  • 2,359
  • 2
  • 23
  • 44

1 Answers1

5

The idea here is to embed links to other related resources within the resource that is requested so that clients can follow those links in order to discover available resources -- just like humans do with the web browsers. You will often find the term HATEOAS (Hypertext As The Enging Of Application State) for this.

With links being present (or not), the server can also tell the client what possible next operations are valid or not.

To set the links you can either put them in the http header or within the body; for the later case the atom-pub format is used.

Heiko Rupp
  • 30,426
  • 13
  • 82
  • 119
  • 1
    For the header, RFC5988 seems to be the RFC specifying it: http://tools.ietf.org/html/rfc5988 – koppor Dec 15 '13 at 22:17