Symfony Camp 2013 UA RESTing with Symfony2
Upcoming SlideShare
Loading in...5
×
 

Symfony Camp 2013 UA RESTing with Symfony2

on

  • 3,204 views

Introduction to REST (RMM, media types and content negotiation) with a short list of Symfony2 bundles. The actual meat of the talk is in the referenced demo application.

Introduction to REST (RMM, media types and content negotiation) with a short list of Symfony2 bundles. The actual meat of the talk is in the referenced demo application.

Statistics

Views

Total Views
3,204
Views on SlideShare
2,086
Embed Views
1,118

Actions

Likes
10
Downloads
25
Comments
0

9 Embeds 1,118

http://blog.evercodelab.com 918
http://localhost 115
http://0.0.0.0 36
https://twitter.com 22
http://feeds.feedburner.com 11
http://dev.symfony2developer.com 6
http://www.inoreader.com 5
http://cloud.feedly.com 4
http://digg.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Symfony Camp 2013 UA RESTing with Symfony2 Symfony Camp 2013 UA RESTing with Symfony2 Presentation Transcript

  • RESTing with Symfony2 Lukas Kahwe Smith | Liip AG smith@pooteeweet.org | @lsmith Sunday, October 27, 13
  • RESTing Introduction to REpresentational State Transfer Lukas Kahwe Smith Sunday, October 27, 13
  • RESTing REST Maturity Model http://martinfowler.com/articles/richardsonMaturityModel.html Lukas Kahwe Smith Sunday, October 27, 13
  • RESTing Level 0: The Swamp of POX •HTTP as a tunneling mechanism •“Procedural” communication (RPC) •Single endpoint (per operation) Lukas Kahwe Smith Sunday, October 27, 13
  • RESTing Level 1: Resources •Individual resources, i.e. URIs •“Object orientated” communication Lukas Kahwe Smith Sunday, October 27, 13
  • RESTing Level 2: HTTP Verbs •Client uses specific HTTP method •Server uses HTTP status codes Lukas Kahwe Smith Sunday, October 27, 13
  • RESTing Level 2: HTTP Methods Method GET HEAD POST PUT DELETE .. Safe? (★) Yes Yes No No No No Idempotent? (✦) Yes Yes No Yes Yes No (★) cacheable (✦) result independent on # of executions Lukas Kahwe Smith Sunday, October 27, 13
  • RESTing Level 2: HTTP status codes Code range Description 1xx Information 2xx Successful 3xx Redirection 4xx Client Error 5xx Server Error Example 100 - Continue 201 - Created 301 - Moved Permanently 404 - Not Found 501 - Not Implemented Lukas Kahwe Smith Sunday, October 27, 13
  • RESTing Level 3: Hypermedia Control •Service discovery via link relations •ATOM, HAL, JSON-LD, IANA Link Rel Lukas Kahwe Smith Sunday, October 27, 13
  • RESTing Hypertext As The Engine Of Application State Sunday, October 27, 13
  • RESTing HATEOAS Sunday, October 27, 13
  • RESTing RMM vs REST vs real life •RMM only covers a subset of REST •RMM Level 2 is what most developer think is sufficient for REST •RMM Level 3 is a REST precondition •RMM Level 3 makes URI formatting matter less Lukas Kahwe Smith Sunday, October 27, 13
  • RESTing RMM vs REST vs real life •REST is protocol independent •Few clients are prepared to leverage HATEOAS enabled REST APIs •Browsers are bad REST clients Lukas Kahwe Smith Sunday, October 27, 13
  • RESTing URIs •Identifies a resource •Independent of a specific format •URI “file extensions” != RESTful Lukas Kahwe Smith Sunday, October 27, 13
  • RESTing Media Types •Identifies a representation format •Custom types «application/vnd.» Header Description Content-Type HTTP message format Accept Accept-Encoding, Accept-Language, .. HTTP response format preference HTTP response preference Lukas Kahwe Smith Sunday, October 27, 13
  • RESTing Content Type Negotiation •Finding appropriate response format •No standardized algorithm available •Apache mod_negotiation algorithm is well documented Lukas Kahwe Smith Sunday, October 27, 13
  • RESTing Content Type Negotiation Accept: application/json,application/ xml;q=0.9,text/html;q=0.8,*/*;q=0.7 Priority Description q=0.9 application/json or application/xml q=0.8 text/html q=0.7 */* (anything) Lukas Kahwe Smith Sunday, October 27, 13
  • RESTing RESTing with Symfony2 Lukas Kahwe Smith Sunday, October 27, 13
  • RESTing Bundles for a REST Server •FOSRestBundle •JMSSerializerBundle •NelmioApiDocBundle •BazingaHateoasBundle ( FSCHateoasBundle ) •TemplatedUriBundle •LiipCacheControlBundle •FOSOAuthServerBundle Lukas Kahwe Smith Sunday, October 27, 13
  • RESTing Bundles for a REST Client •FOSRestBundle •JMSSerializerBundle •HWIOAuthBundle •MisdGuzzleBundle Lukas Kahwe Smith Sunday, October 27, 13
  • RESTing Demo Time! https://github.com/lsmith77/ symfony-rest-edition/tree/2.3 Lukas Kahwe Smith Sunday, October 27, 13
  • RESTing Further reading •http://martinfowler.com/articles/ richardsonMaturityModel.html •http://roy.gbiv.com/untangled/2008/rest-apismust-be-hypertext-driven •http://www.slideshare.net/Wombert/ designing-http-interfaces-and-restful-webservices-dpc2012-20120608 •http://williamdurand.fr/2012/08/02/rest-apiswith-symfony2-the-right-way/ •http://knpuniversity.com/blog/what-the-rest •http://knpuniversity.com/blog/rest-revisited Lukas Kahwe Smith Sunday, October 27, 13