1 / 89

James Crisp

James Crisp. The Web. *-ilities. Scalability. Recoverability & Reliability. Security. Discoverability. How to bring to Web services?. Tunneling. RPC URLs POX SOAP & WS-*. RE presentational S tate T ransfer. “REST contributes ... the rationale

wilkersonj
Download Presentation

James Crisp

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. James Crisp

  2. The Web

  3. *-ilities

  4. Scalability

  5. Recoverability & Reliability

  6. Security

  7. Discoverability

  8. How to bring to Web services?

  9. Tunneling RPC URLs POX SOAP & WS-*

  10. REpresentational State Transfer

  11. “REST contributes ... the rationale behind the modern Web's software architecture...” -- Roy Fielding

  12. Resources e.g. Person, Car, Post

  13. Representations <person> <name>Bill Gates</name> <gender>m</gender> </person>

  14. Addressability http://mysite.com/people/joe_citizen http://mysite.com/people/joe_citizen/friends

  15. Uniform Interface

  16. GET POST HEAD PUT DELETE OPTIONS Support

  17. GET GET /people/joe_citizen HTTP/1.1 Host: mysite.com Accept: application/xml

  18. Response 200 OK Content-Type: application/xml Last-Modified: 2008-1-1 15:00.. <person> <name>Joe Citizen</name> <age>42</age> <gender>m</gender> </person>

  19. HEAD HEAD /people/joe_citizen HTTP/1.1 Host: mysite.com 200 OK Content-Type: application/xml Last-Modified: 2008-1-1 15:00.. ETag: a32daf15-b33da2a4d Response

  20. POST POST /people HTTP/1.1 Content-Type: text/xml Host: mysite.com .... <person> <name>Tina Jones</name> <age>25</age> <gender>F</gender> </person>

  21. Response 201 CREATED Location: /people/tina_jones (optionally with body)

  22. PUT PUT /people/tina_jones HTTP/1.1 Content-Type: text/xml Host: mysite.com .... <person> <name>Tina Jones</name> <age>24</age> <gender>F</gender> </person>

  23. Response 200 OK Location: /people/tina_jones (optionally with body)

  24. DELETE DELETE /people/joe_citizen HTTP/1.1 Host: mysite.com 200 OK Content-Type: application/xml <admin:personDeleted> joe_citizen </admin:personDeleted> Response

  25. OPTIONS OPTIONS /people HTTP/1.1 Host: mysite.com Response 200 OK Allowed: GET,HEAD,POST

  26. Status Codes

  27. 2xx = All good 200 – OK 201 – Created

  28. 3xx = Redirect 301 – Moved permanently 307 – Temporary redirect304 – Not modified (ie, see cache)

  29. 4xx = Client error 400 – Bad request 401 – Unauthorized 403 – Forbidden 405 – Method not allowed 409 – Conflict

  30. 5xx = Server error 500 – Internal server error

  31. Headers

  32. Content-Type: text/html application/xml image/jpeg ....

  33. WWW-Authenticate: Authorization:

  34. Last-Modified: If-Modified-Since: ETag: If-None-Match:

  35. Location:

  36. Describe your services?

  37. URI Templates http://s3.amazon.com/{bucket-name}/{object-name} http://mysite.com/users/{user-name}/photos http://google.com/search?q={search-query}

  38. Start URL + Links https://bank.com/accounts/345095 <account> <name>Tina Jones</name> <link rel="history" href="/tjones/account_history"> <link rel="close" verb="delete" href="/tjones"> </account>

  39. Microformats <account> <name>Tina Jones</name> <link rel="transaction-search" href="account_history? from={date-from}& to={date-to}"> </account>

  40. State Management http://google.com Searching Search google.com/search?q=rest Searched Next Page google.com/search?q=rest&start=10 More Results

  41. Data Format?

  42. XHTML <h1>Accounts</h1> <ul> <li> <a rel="account_details" href="/tjones">Tina Jones</a> </li> <li> .....

  43. JSON { "account_name": "Tina Jones", "links": {"history": "/tjones/history"} }

  44. <XML></XML>

More Related