Engwar

Chintana Wilamuna's weblog

RESTful PHP Web Services

with 3 comments

If you’ve read the architectural notes about RESTful applications and want to get your hands dirty writing one quickly, RESTful PHP Web Services by Samisa Abeysinghe is a book you should read. It starts with an introduction to what REST is and surrounding technologies. Since many web applications today expose their functions as RESTful APIs, you’ll be better prepared to play around with these after reading this book. Also a simple application that explains all the necessary functions for developing a RESTful application is discussed.

Introduction gives the reader a head start about what REST is all about and tools needed to play with RESTful web services. Then PHP libraries and function used for talking to a REST service is explained. How CURL is used to send requests with various HTTP verbs such as GET, POST, PUT, DELETE are explained with examples. After getting an XML response from a service, PHP libraries for manipulating XML and extracting parts of data you want is illustrated with samples. One could directly copy and paste these codes and try it out as they read along. Then the author goes on to explain how to use Flickr with PHP using CURL. If you’ve been using a high level library that insulate the lower level details, this example shows some of the basic API calls and how to use them.

After explaining a mashup of BBC news feed and Yahoo search API, author explains how to design RESTful services. This is carried out along with the simple but complete example of a library system. How to provide a service as well as consuming that using PHP and CURL is explained with complete code samples. Then he explains how to design the same thing using the Zend Framework.

The book concludes with a chapter dedicated to debugging REST web services. Using the TCPMon tool to capture messages and look for possible errors. The chapter ends with a set of best practices that everyone should be aware of if you do any programming with REST web services. The book also mentions WSF/PHP as an advanced framework providing many more functionality amidst of acting as a REST framework. I highly recommend this book if you’re a PHP programmer waiting to get your hands dirty designing RESTful applications. To whet your appetite here’s a sample chapter from the book about designing and implementing resource oriented clients. Enjoy!

Written by Chintana

February 22nd, 2009 at 7:31 am

3 Responses to 'RESTful PHP Web Services'

Subscribe to comments with RSS or TrackBack to 'RESTful PHP Web Services'.

  1. [...] from: Engwar » Blog Archive » RESTful PHP Web Services :a-high-level, architectural, books, design-the-same, flickr, PHP, restful-php-web-services, [...]

  2. [...] Continued here:  Engwar » Blog Archive » RESTful PHP Web Services [...]

  3. Hi buddy,

    I searched a lot for the RESTful PHP Web Service by Samisa Abeysinghe, but I could not find the free copy. If you have read the same book, please share some ideas of it, or you may also share the e-book.

    Remember Knowledge grows when you share it with others.

    Take Care.

    Arpit Joshi

    21 Apr 09 at 5:31 am

Leave a Reply