PUT, DELETE, POST Well defined semantics GET does not kill kittens PUT and DELETE are idempotent POST is unsafe A client knows exactly what it can do with a resource
– Any server in a cluster can handle any request – All the result pages can safely be cached • More reliable – A client can safely re-send a request • Better resource reuse – All the result pages can safely be linked to
Specify max-age – Use max-age cache control header Split data according to freshness requirement Separate private and public data – Use private and public cache control header Support conditional GET – Get if modified since – E-tags
Ex: an image can be available as gif or jpeg • Media types can be negotiated with HTTP – Client can send Accept headers • Prefer media types that lets you link resources – Atom – XHTML+Microformats
Reduced server load (caching) Improved server scalability (no session state) Client software can be reused (uniform interface) No separate resource discovery needed (hyperlinks) Easy to serve different types of content such as images, videos, xl-sheets etc.
should be simple to design simple things. In reality, the effort required to design something is inversely proportional to the simplicity of the result.” - Roy Fielding
Client can use HTTP OPTIONS command Content-type headers Links let the client navigate the API In theory no description language should be needed There are some description languages though WADL WSDL2.0
5 – http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm Roy Fieldings blog – http://roy.gbiv.com/untangled/ Mark Hadleys blog – http://weblogs.java.net/blog/mhadley/ Mark Nottinghams blog – http://www.mnot.net Stefan Tilkovs blog – http://www.innoq.com/blog/st/