restful rabbits

24
RESTful Rabbits

Upload: gareth-rushgrove

Post on 16-Jan-2015

3.161 views

Category:

Technology


2 download

DESCRIPTION

A BarCamp Brighton presentation by Gareth Rushgrove on RESTful architectures and the Nabaztag

TRANSCRIPT

Page 1: RESTful Rabbits

RESTful Rabbits

Page 2: RESTful Rabbits

The Northtm

Page 3: RESTful Rabbits

REST

Representational State Transfer (REST) is a style of software architecture for distributed hypermedia

systems such as the World Wide Web

http://roy.gbiv.com/pubs/dissertation/top.htm

Page 4: RESTful Rabbits

HTTP Verbs

GET, POST, PUT, DELETE, TRACE, OPTIONS, CONNECT, HEAD

http://tools.ietf.org/html/rfc2616

Page 5: RESTful Rabbits

Resource Orientated Design

Page 6: RESTful Rabbits

Nouns and Verbs

Nouns are resources you act upon

Verbs are what you do to those resources

Generally this means GET, POST, PUT and DELETE

Page 7: RESTful Rabbits

No matter what web server you have, and no matter what web client I have, I know if I see a URL of your,

that I can retrieve the associated document using HTTP GET, with no advance co-ordination needed

other than agreement on the relevant specs

Cool Stuff

http://rest.blueoxen.net/cgi-bin/wiki.pl?AnotherRestDescription

Page 8: RESTful Rabbits

Flickr Bashing

Page 9: RESTful Rabbits

Flickr API

Page 10: RESTful Rabbits

GET /photos/garethrGET /people/garethr/contactsPUT /photos/garethrPUT /people/garethr/contacts/PUT /peopleGET /photos/garethr/tags

Flickr RESTful API?

Page 11: RESTful Rabbits

201 Created

2xx Success

Page 12: RESTful Rabbits

3xx Redirection

Page 13: RESTful Rabbits

400 Bad Request401 Unathorized403 Forbidden404 Not Found410 Gone412 Precondition Failed

4xx Client Error

Page 14: RESTful Rabbits

5xx Server Error

501 Not Implemented503 Service Temporarily Unavailable

Page 15: RESTful Rabbits

Rabbits?

Page 16: RESTful Rabbits

Rabbits!

Page 17: RESTful Rabbits

posright Position of the right ear between 0 and 16 posleft Position of the left ear between 0 and 16 ears=ok Send the position of the ears

http://api.nabaztag.com/vl/FR/api.jsp

Nabaztag API

Page 18: RESTful Rabbits

GET /ears/leftGET /ears/rightPUT /ears/leftPUT /ears/rightPOST /mouthGET /name

Nabaztag RESTful API

Page 19: RESTful Rabbits

A Rabbit called Cambridge

Page 20: RESTful Rabbits

Microformats and REST sitting in a tree

Page 21: RESTful Rabbits

Microformats for Write APIs

+

Page 22: RESTful Rabbits

Read Books

Page 24: RESTful Rabbits

Any Questions?