Post on 10-May-2015
description
Hyper Fantasy
Adventures In Hypermedia
Jim Barritt
Prologue
• REST – Roy Fielding
• REST IN PRACTICE – Jim Webber, Ian Robinson, Savas Parastatdis
• RESTFULIE – Guilherme Silveira, Lucas Cavalcanti
Love to <Link>• Hypermedia Controls
• <atom:link href=“” rel=“” />
• <a href=“” rel=“” >Link to somewhere</a>
• Media types– application/xhtml+xml– text/html– application/xml– application/json– application/vnd.restbucks+xml
Talking in Http
• HEAD GET PUT POST DELETE
• 200 (ok)• 404 (not found)• 500 (internal error)• 418 (I’m a teapot)
– http://www.faqs.org/rfcs/rfc2324.html
• Accept: text/* application/xml
RESTafarianism• Client-Server
• Stateless
• Cacheable
• Layered System
• Uniform interface– Identification of resources– Manipulation of resources via representations– Self-descriptive messages– HATEOAS (Hypermedia as the engine of application state)
• Code on demand (optional)
Restfulie• Why would I use restfulie?
• 1. Easy —> writing hypermedia aware resource based clients
• 2. Easy —> hypermedia aware resource based services
• 3. Small → it’s not a bloated solution with a huge list of APIs
• 4. HATEOAS —> clients you are unaware of will not bother if you change your URIs
• 5. HATEOAS —> services that you consume will not affect your software whenever they change part of their flow or URIs
Hyperia
To the CODE!
Epilogue• http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm
• http://www.facebook.com/RESTinPractice
• http://github.com/caelum/restfulie-java
London geek night 22nd November
• http://github.com/jimbarritt/spikes/tree/master/restfulie/