REST 11.07.2009Understanding and Using RESTful APIs
About MeDeveloping software for 15 years
Bulk of experience on enterprise-scale applications
Microsoft platform (mostly)
KeyLimeTieOverviewAlthough REST is 10 years old, APIs based on the REST model continue to become an integral part of the technology landscape. ProgrammableWeb.com lists 1051 RESTful APIs, 4422 Mashups.We’ll look atBasic REST Concepts
Using REST
WADLRest overview
REST OverviewAPIs based on the Representational State Transfer (REST) architecture dominate web 2.0 mash-up and social media development.There are a number of frameworks available that support the development of RESTful APIs (WCF, JAX-RS, Wicket, Zend)We are still missing an established mechanism for documentation and discovery and client-side tool support for rapid implementation.
REST OverviewREST-style architectures consist of clients and servers. Requests and responses are built around the transfer of "representations" of "resources". A resource is any entity that can be addressed in a URI (an account, an employee, a physical file)A representation of a resource is any information that captures the current or intended state of a resource. All information necessary to process and complete a request is contained within it.
ExampleResource (Twitter Public Timeline)	http://twitter.com/statuses/public_timeline.xmlResource (Twitter User)	http://twitter.com/users/petermorano.xml
REST OverviewREST-style architectures consist of clients and servers. Requests and responses are built around the transfer of "representations" of "resources". A resource is any entity that can be addressed in a URI (an account, an employee, a physical file)A representation of a resource is any information that captures the current or intended state of a resource. All information necessary to process and complete a request is contained within it.
Wait a MinuteIf this sounds a lot like the Web, it’s because the Web is a REST implementationRoy Fielding, who created REST, was also one of the principal authors of HTTP
REST BasicsThe REST architecture was designed around a few key principles: Use HTTP Methods (and Response Codes)
 Be Stateless and Cacheable
 Use Addressable Resources
 Support the transfer of RepresentationsREST BasicsThe REST architecture was designed around a few key principles:Use HTTP Methods (and Response Codes)
 Be Stateless and Cacheable
 Use Addressable Resources
 Support the transfer of RepresentationsHTTP MethodsMap to CRUD OperationsActionSQLHTTP MethodCreateInsertPostReadSelectGetUpdateUpdatePutDeleteDeleteDelete
URI ExamplesGEThttp://www.example.com/v1/employeesGEThttp://www.example.com/v1/employees/1824POSThttp://www.example.com/v1/employeesPUThttp://www.example.com/v1/employees/1513DELETEhttp://www.example.com/v1/employees/1222
REST BasicsThe REST architecture was designed around a few key principles: Use HTTP Methods (and Response Codes)
Be Stateless and Cacheable
 Use Addressable Resources
 Support the transfer of RepresentationsStateless and CacheableNo State Stored on the Server
 Every HTTP request executes in complete isolation on the server
 Easier to scale because of GET methodREST BasicsThe REST architecture was designed around a few key principles: Use HTTP Methods (and Response Codes)
 Be Stateless and Cacheable
Use Addressable Resources
 Support the transfer of RepresentationsResourcesAny THING – person, concept, artifact
 Anything you can point to
 Explicit Request and Response – No StateREST BasicsThe REST architecture was designed around a few key principles: Use HTTP Methods (and Response Codes)
Be Stateless and Cacheable
 Addressable Resources
Support the transfer of RepresentationsRepresentationsA serializable description of a Resource
 Resources are modifiable through Representations

Understanding and Using Rest APIs (SocialDevCamp Chicago 2009)