Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
REST EasyBuilding RESTful Services in Zend Framework
Me•   Fightin’ Texas Aggie•   .Net and PHP Developer•   UNIX and Windows Sysadmin•   Senior Consultant at    Improving Ent...
Twitter Promotion
Twitter Promotion•   @neraath
Twitter Promotion•   @neraath•   #bcsphp
Twitter Promotion•   @neraath•   #bcsphp•   #rest
Twitter Promotion•   @neraath•   #bcsphp•   #rest•   #thisguyisawesome
Twitter Promotion•   @neraath•   #bcsphp•   #rest•   #thisguyisawesome•   #bestspeakerever
Twitter Promotion•   @neraath•   #bcsphp•   #rest•   #thisguyisawesome•   #bestspeakerever•   #horriblepresenter
Twitter Promotion•   @neraath•   #bcsphp•   #rest•   #thisguyisawesome•   #bestspeakerever•   #horriblepresenter•   #omgsh...
Agile, Microsoft, Open Technologies, UXApplied Training, Coaching, MentoringCertified ConsultingRural SourcingRecruiting Se...
REST
REpresentational State      Transfer
Why REST?
Scalability
ArchitectureIndependence
Resource Addressing and Management
Self-Describing Messages
REST is NOT
SOAP is Fugly<?xml version="1.0"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">  <soap:Header>  </s...
RESTs Beauty is in  HTTP Verbs
http://www.example.org/stock/price/IBM
GETRequestGET /stock/price/IBM HTTP/1.1Host: www.example.orgUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4)Acce...
POSTRequestPOST /stock/price/IBM HTTP/1.1Host: www.example.orgCache-Control: max-age=0User-Agent: Mozilla/5.0 (Macintosh; ...
PUTRequestPUT /stock/price/IBM HTTP/1.1Host: www.example.orgCache-Control: max-age=0User-Agent: Mozilla/5.0 (Macintosh; In...
DELETERequestDELETE /stock/price/IBM HTTP/1.1Host: www.example.orgUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_...
Status Codes are Your        Friend
200 =
201 = Created
204 = ?
301 = ?
401 = ?
404, 500, etc.
REST Supports{    “person”:    {        “name”: “Chris Weldon”,        “email”: “chris@chrisweldon.net”    }}
REST Supports<?xml version=”1.0”?><person>  <name>Chris Weldon</name>  <email>chris@chrisweldon.net</name></person>
REST Supports      ...
DEMO
Thanks!spkr8.com/neraath
REST Easy - Building RESTful Services in Zend Framework
REST Easy - Building RESTful Services in Zend Framework
REST Easy - Building RESTful Services in Zend Framework
REST Easy - Building RESTful Services in Zend Framework
REST Easy - Building RESTful Services in Zend Framework
REST Easy - Building RESTful Services in Zend Framework
Upcoming SlideShare
Loading in …5
×

REST Easy - Building RESTful Services in Zend Framework

3,495 views

Published on

The epicenter of data sharing in "Web 2.0" are web services. Whether you like it or not, you are consuming literally hundreds of services a day, whether it be searching in Google, running Facebook on your mobile device, or searching the App Store on your tablet. Yet, despite our hunger for services, few have ever written one. In this session, you'll learn what are RESTful web services and how to get started creating them in Zend Framework.

Published in: Technology
  • Be the first to comment

REST Easy - Building RESTful Services in Zend Framework

  1. 1. REST EasyBuilding RESTful Services in Zend Framework
  2. 2. Me• Fightin’ Texas Aggie• .Net and PHP Developer• UNIX and Windows Sysadmin• Senior Consultant at Improving Enterprises• chris@chrisweldon.net
  3. 3. Twitter Promotion
  4. 4. Twitter Promotion• @neraath
  5. 5. Twitter Promotion• @neraath• #bcsphp
  6. 6. Twitter Promotion• @neraath• #bcsphp• #rest
  7. 7. Twitter Promotion• @neraath• #bcsphp• #rest• #thisguyisawesome
  8. 8. Twitter Promotion• @neraath• #bcsphp• #rest• #thisguyisawesome• #bestspeakerever
  9. 9. Twitter Promotion• @neraath• #bcsphp• #rest• #thisguyisawesome• #bestspeakerever• #horriblepresenter
  10. 10. Twitter Promotion• @neraath• #bcsphp• #rest• #thisguyisawesome• #bestspeakerever• #horriblepresenter• #omgshootme
  11. 11. Agile, Microsoft, Open Technologies, UXApplied Training, Coaching, MentoringCertified ConsultingRural SourcingRecruiting Services
  12. 12. REST
  13. 13. REpresentational State Transfer
  14. 14. Why REST?
  15. 15. Scalability
  16. 16. ArchitectureIndependence
  17. 17. Resource Addressing and Management
  18. 18. Self-Describing Messages
  19. 19. REST is NOT
  20. 20. SOAP is Fugly<?xml version="1.0"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"> <soap:Header> </soap:Header> <soap:Body> <m:GetStockPrice xmlns:m="http://www.example.org/stock"> <m:StockName>IBM</m:StockName> </m:GetStockPrice> </soap:Body></soap:Envelope>
  21. 21. RESTs Beauty is in HTTP Verbs
  22. 22. http://www.example.org/stock/price/IBM
  23. 23. GETRequestGET /stock/price/IBM HTTP/1.1Host: www.example.orgUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4)Accept-Encoding: gzipAccept-Charset: ISO-8859-1,UTF-8;q=0.7,*;q=0.7Cache-Control: no-cacheAccept-Language: de,en;q=0.7,en-us;q=0.3Responsedate: Thu, 21 Jun 2012 21:55:57 GMTversion: HTTP/1.1status: 200 OKcontent-length: 26550content-type: text/html; charset=UTF-8cache-control: private, max-age=0expires: -1
  24. 24. POSTRequestPOST /stock/price/IBM HTTP/1.1Host: www.example.orgCache-Control: max-age=0User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4)Content-Type: application/x-www-form-urlencodedAccept: text/html,application/xhtml+xml;q=0.9,*/*;q=0.8currentPrice:193.39delta:-5.39locale:en_USResponseDate: Thu, 21 Jun 2012 21:55:57 GMTVersion: HTTP/1.1Status: 201 CREATEDLocation: /stock/price/IBM
  25. 25. PUTRequestPUT /stock/price/IBM HTTP/1.1Host: www.example.orgCache-Control: max-age=0User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4)Content-Type: application/x-www-form-urlencodedAccept: text/html,application/xhtml+xml;q=0.9,*/*;q=0.8currentPrice:193.39delta:-5.39locale:en_USResponseDate: Thu, 21 Jun 2012 21:55:57 GMTVersion: HTTP/1.1Status: 200 OK
  26. 26. DELETERequestDELETE /stock/price/IBM HTTP/1.1Host: www.example.orgUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4)Accept-Encoding: gzipAccept-Charset: ISO-8859-1,UTF-8;q=0.7,*;q=0.7Cache-Control: no-cacheAccept-Language: de,en;q=0.7,en-us;q=0.3Responsedate: Thu, 21 Jun 2012 21:55:57 GMTversion: HTTP/1.1status: 204 NO CONTENT
  27. 27. Status Codes are Your Friend
  28. 28. 200 =
  29. 29. 201 = Created
  30. 30. 204 = ?
  31. 31. 301 = ?
  32. 32. 401 = ?
  33. 33. 404, 500, etc.
  34. 34. REST Supports{ “person”: { “name”: “Chris Weldon”, “email”: “chris@chrisweldon.net” }}
  35. 35. REST Supports<?xml version=”1.0”?><person> <name>Chris Weldon</name> <email>chris@chrisweldon.net</name></person>
  36. 36. REST Supports ...
  37. 37. DEMO
  38. 38. Thanks!spkr8.com/neraath

×