Skip to content

Instantly share code, notes, and snippets.

@psahni
Created March 31, 2014 12:53
Show Gist options
  • Save psahni/9891633 to your computer and use it in GitHub Desktop.
Save psahni/9891633 to your computer and use it in GitHub Desktop.
Hypermedia
      [ Hypermedia ]
  • Hypermedia allows links to be embedded in multimedia elements like images and videos.

  • HATEOAS - Hypermedia As The Engine Of Application State

  • Roy fielding creator of Http and Rest devised that REST api must be hypermedia driven. It means the the client only knows about the starting uri of the server, client should be able to navigate through one uri. The author of the api should be able to inform the client about the links.

"Roy T. Fielding REST APIs Must Be Hypertext-driven"

  • Keeping the client decoupled.

  • When staring a communication with the server, two things are important

    • RooT URI
    • Media type, for example text/html or application/json. Responsible for the behaviour
  • Example json return {:content => content[:content], :links => [:rel => 'self', :href => request.url]}.to_json

application/json payload that is parsable media types custom media types rules applied to payload

Who created HTTP ? Roy Fieling

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment