REST Easy - Building RESTful Services in Zend Framework

3,412 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
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,412
On SlideShare
0
From Embeds
0
Number of Embeds
12
Actions
Shares
0
Downloads
27
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • 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

    ×