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.
Introduction to RESTful Webservice                    Eftakhairul Islam                           Jr. Software Engineer   ...
What is Webservice?phpXpert Seminar 2011                      2
Webservice Design Models         XML RPC          SOAP          REST     phpXpert Seminar 2011                 3
Inside RESTful Webservice?        Not Techology and not even protocol        Software archetechtural principle        R...
Basic Design Principles Of REST1.  HTTP methods explicitly2.  Be stateless3.  Directory structure­like URIs4. Transfer res...
HTTP Methods Explicitly                             Add ResourcesPOST http://api.linkedin.com/v1/people/123/friendsContent...
HTTP Methods Explicitly                                      Retrieve ResourcesGET http://api.linkedin.com/v1/people/123Ou...
HTTP Methods Explicitly                                    Update ResourcesPUT  http://api.linkedin.com/v1/people/123Conte...
HTTP Methods Explicitly                                      Delete ReasourceDELETE http://api.linkedin.com/v1/people/123/...
Be StatelessStateful design (Non­REST):                                           previousPage++  Client                  ...
Be Stateless     Stateless design (REST):              GET /resources/?page=2 HTTP/1.1                    <?xml version= ”...
Directory Structure­like URIshttp://example.com/topics/{topic_name}http://graph.facebook.com/10150224661566729http://twitt...
Transfer Resources By Any Valid MIME TypeMostly Used         XML         JSON         XHTMLAny other valid contend type...
Thank You    Please Stop Software Piracy, Save Developer                    Use FOSS or Genuine SoftwarephpXpert Seminar 2...
Upcoming SlideShare
Loading in …5
×

Introduction to RESTful Webservice

2,665 views

Published on

Published in: Technology, News & Politics
  • Be the first to comment

  • Be the first to like this

Introduction to RESTful Webservice

  1. 1. Introduction to RESTful Webservice Eftakhairul Islam Jr. Software Engineer Right Brain Solution Ltd. email: eftakhairul@gmail.com web: http://eftakhairul.com
  2. 2. What is Webservice?phpXpert Seminar 2011  2
  3. 3. Webservice Design Models XML RPC  SOAP  REST  phpXpert Seminar 2011  3
  4. 4. Inside RESTful Webservice? Not Techology and not even protocol Software archetechtural principle Resouces transfer over HTTPphpXpert Seminar 2011  4
  5. 5. Basic Design Principles Of REST1.  HTTP methods explicitly2.  Be stateless3.  Directory structure­like URIs4. Transfer resources by any valid MIME type  supported by the web service.phpXpert Seminar 2011  5
  6. 6. HTTP Methods Explicitly Add ResourcesPOST http://api.linkedin.com/v1/people/123/friendsContent­Type: application/xml<friend uri=“urn:linkedin:v1:people/888”/> phpXpert Seminar 2011  6
  7. 7. HTTP Methods Explicitly Retrieve ResourcesGET http://api.linkedin.com/v1/people/123Output:<?xml version="1.0" encoding="UTF­8"?><person>     <id>123</id>     <first­name>Sakib</first­name>     <last­name>Stein</last­name>     <connections total="200">     …</person> phpXpert Seminar 2011  7
  8. 8. HTTP Methods Explicitly Update ResourcesPUT  http://api.linkedin.com/v1/people/123Content­Type: application/xml<person>    <name>Sakib Mahmud</name>   <best­friend uri=“urn:linkedin:v1:people/999”/>   <photo xsi:nil=“true”/></person> phpXpert Seminar 2011  8
  9. 9. HTTP Methods Explicitly Delete ReasourceDELETE http://api.linkedin.com/v1/people/123/friends/456Output:Friend:456 will be deleted from linkedin. phpXpert Seminar 2011  9
  10. 10. Be StatelessStateful design (Non­REST): previousPage++ Client Server nextPage = previousPage return nextPage phpXpert Seminar 2011  10
  11. 11. Be Stateless Stateless design (REST): GET /resources/?page=2 HTTP/1.1 <?xml version= ”1.0” ?> <rsp page=”2” nextPage=”3”> Client <resource id = 11/> Server <resource id = 12”/> . .. </rsp>phpXpert Seminar 2011  11
  12. 12. Directory Structure­like URIshttp://example.com/topics/{topic_name}http://graph.facebook.com/10150224661566729http://twitter.com/statuses/user_timeline.xml? id=eftakhairul phpXpert Seminar 2011  12
  13. 13. Transfer Resources By Any Valid MIME TypeMostly Used XML JSON XHTMLAny other valid contend type phpXpert Seminar 2011  13
  14. 14. Thank You Please Stop Software Piracy, Save Developer Use FOSS or Genuine SoftwarephpXpert Seminar 2011  14

×