Your SlideShare is downloading. ×
0
 
Niklas Gustavsson [email_address] http://protocol7.com http://twitter.com/protocol7
REST
REST?
HTTP 1.1
Some HTTP history http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm
Some HTTP history
HTTP used right
Constraints
Constraints Everything is a resource
Constraints Every resource has an identifier (URL) http://example.com/reports/niklas
Constraints Transfer representations Defined by content-types
Constraints All resources expose a uniform interface  GET, POST, PUT, DELETE
Constraints Hypermedia as the engine of application state
http://gowalla.com/api/explorer
Constraints Client-server, Stateless, Cacheable, Layered
Why?
Why? It's easy! Well, it's not
Why? It's what others use
Why? The web has been successful, copy!
Why? Interoperability on the right level
Patterns
Collection resource http://example.com/contacts
GET to retrieve links to all items GET http://example.com/contacts HTTP/1.1 200 OK { [ {“url” : “/contacts/123”},  {“url” ...
GET to retrieve a specific item GET http://example.com/contacts/123 HTTP/1.1 200 OK { “name” : “Kalle Anka” }
POST to create new POST http://example.com/contacts { “name” : “Niklas Gustavsson” } HTTP/1.1 201 Created Location: http:/...
PUT to update PUT http://example.com/contacts/123 { “name” : “Niklas Anka” } HTTP/1.1 200 OK
DELETE to delete DELETE http://example.com/contacts/123 HTTP/1.1 204 No content
Advanced stuff
Link relations http://www.infoq.com/articles/webber-rest-workflow
AtomPub
Reliability
Async
Frameworks!
Want more?
Demo http://github.com/protocol7/rest-demo
Questions?
Upcoming SlideShare
Loading in...5
×

RESTful web services

948

Published on

Presentation on REST principles and patterns held at Region Västra Götaland

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
948
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
21
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • From Göteborg Callista
  • From Göteborg Callista
  • From Göteborg Callista
  • From Göteborg Callista
  • From Göteborg Callista
  • From Göteborg Callista
  • From Göteborg Callista
  • From Göteborg Callista
  • From Göteborg Callista
  • From Göteborg Callista
  • From Göteborg Callista
  • From Göteborg Callista
  • From Göteborg Callista
  • From Göteborg Callista
  • From Göteborg Callista
  • From Göteborg Callista
  • From Göteborg Callista
  • From Göteborg Callista
  • From Göteborg Callista
  • From Göteborg Callista
  • From Göteborg Callista
  • From Göteborg Callista
  • From Göteborg Callista
  • From Göteborg Callista
  • From Göteborg Callista
  • From Göteborg Callista
  • From Göteborg Callista
  • From Göteborg Callista
  • From Göteborg Callista
  • From Göteborg Callista
  • From Göteborg Callista
  • From Göteborg Callista
  • From Göteborg Callista
  • From Göteborg Callista
  • Transcript of "RESTful web services"

    1. 2. Niklas Gustavsson [email_address] http://protocol7.com http://twitter.com/protocol7
    2. 3. REST
    3. 4. REST?
    4. 5. HTTP 1.1
    5. 6. Some HTTP history http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm
    6. 7. Some HTTP history
    7. 8. HTTP used right
    8. 9. Constraints
    9. 10. Constraints Everything is a resource
    10. 11. Constraints Every resource has an identifier (URL) http://example.com/reports/niklas
    11. 12. Constraints Transfer representations Defined by content-types
    12. 13. Constraints All resources expose a uniform interface GET, POST, PUT, DELETE
    13. 14. Constraints Hypermedia as the engine of application state
    14. 15. http://gowalla.com/api/explorer
    15. 16. Constraints Client-server, Stateless, Cacheable, Layered
    16. 17. Why?
    17. 18. Why? It's easy! Well, it's not
    18. 19. Why? It's what others use
    19. 20. Why? The web has been successful, copy!
    20. 21. Why? Interoperability on the right level
    21. 22. Patterns
    22. 23. Collection resource http://example.com/contacts
    23. 24. GET to retrieve links to all items GET http://example.com/contacts HTTP/1.1 200 OK { [ {“url” : “/contacts/123”}, {“url” : “/contacts/124”}, ]}
    24. 25. GET to retrieve a specific item GET http://example.com/contacts/123 HTTP/1.1 200 OK { “name” : “Kalle Anka” }
    25. 26. POST to create new POST http://example.com/contacts { “name” : “Niklas Gustavsson” } HTTP/1.1 201 Created Location: http://example.com/contacts/456
    26. 27. PUT to update PUT http://example.com/contacts/123 { “name” : “Niklas Anka” } HTTP/1.1 200 OK
    27. 28. DELETE to delete DELETE http://example.com/contacts/123 HTTP/1.1 204 No content
    28. 29. Advanced stuff
    29. 30. Link relations http://www.infoq.com/articles/webber-rest-workflow
    30. 31. AtomPub
    31. 32. Reliability
    32. 33. Async
    33. 34. Frameworks!
    34. 35. Want more?
    35. 36. Demo http://github.com/protocol7/rest-demo
    36. 37. Questions?
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×