5. Web Linking

Previous Next

This chapter shows when and how to use links in representations, and covers details of links in the body of representations, link headers, URI templates and ap- plications of links.

  1. How to Use Links in XML Representations
  2. How to Use Links in JSON Representations
  3. When and How to Use Link Headers
  4. How to Assign Link Relation Types
  5. How to Use Links to Manage Application Flow
  6. How to Deal With Ephemeral URIs
  7. When and How to Use URI Templates
  8. How to Use Links in Clients

{ 3 comments… read them below or add one }

Erik Terpstra November 12, 2010 at 10:10 am

In the section ‘How to Use Links in JSON Representations’ you suggest the following format:

“links” : [
"rel" : "alternate",
"href" : "http://east-nj1.photos.example.org/987/nj1-1234"
"rel" : "http://www.example.org/rels/owner",
"href" : "http://east-nj1.photos.example.org/987",

But doesn’t it make more sense to use the ‘rel’ attribute as a key instead?
In that case it will become:

“links” : {
“alternate”: {
“href” : “http://east-nj1.photos.example.org/987/nj1-1234″
“href” : “http://east-nj1.photos.example.org/987″,

Also see: http://www.scribd.com/doc/34404374/DevFest-Kuala-Lumpur-The-Google-Buzz-API-And-You
(search for the keyword ‘image_thumb’)

Thanks for you great book.




Subbu Allamaraju November 27, 2010 at 10:38 pm

Erik, that’s certainly an option, as I point out on page 91 towards the end of Recipe 5.2.


Erik Terpstra November 12, 2010 at 10:12 am

Hmmm, apparently leading spaces are not support in the comments, sorry for the messy result.


Leave a Comment