3. What is REST
âȘStands For:
âȘREpresentational State Transfer
âȘArchitectural Style based on HTTP
10/8/2013 3
4. What is HTTP?
âȘWell defined protocol (web browsers, web servers, etc.)
âȘRequest and Response
âȘStateless
âȘRequest Contents
âȘURL
âȘHTTP Verb
âȘHeader
âȘMessage Body
10/8/2013 4
5. What is REST
âȘArchitectural Style based on HTTP
âȘResources (Things)
âȘVerbs (Actions)
âȘGET, POST, PUT, DELETE, etc.
âȘResponse gives a representation of the resource (XML, JSON,
image, etc.)
More Info: http://en.wikipedia.org/wiki/REST
10/8/2013 5
7. HTTP Verbs
âȘGET
âȘGets 0 or more of a resource (thing)
âȘPOST
âȘCreates a resource (hopefully)
âȘPUT
âȘUpdates a resource (hopefully)
âȘDELETE
âȘDeletes a resource (hopefully)
10/8/2013 7
8. REST in Action
Actions:
âȘ GET
âȘ POST
âȘ PUT
âȘ DELETE
Resources:
âȘ http://somedomain.com/users/1
âȘ https://otherdomain.com/products
10/8/2013 8
9. REST Responses
âȘResponses come back as an HTTP Status Code + message (maybe)
âȘHTTP Status Codes
âȘ1XX â Request Received and Iâm processing it
âȘ2XX â Request Received and processed it successfully!
âȘ3XX â Client must do something else to complete the request
âȘ4XX â Client made an error
âȘ5XX â Server error
10/8/2013 9
10. Popular Status Codes
âȘ200 â Success
âȘ201 â Created
âȘ301 â Moved Permanently (AKA âredirectâ)
âȘ404 â Not Found
âȘ401 â Unauthorized
âȘ500 â Internal Server Error (AKA âoh crap!â)
10/8/2013 10