RESTful Web Services and Drupal
An introduction to web services, REST, and RESTful web services in Drupal.
Drupal is usually used to create web sites for humans. But Drupal can also be used to create web sites intended for machines (e.g. web services) and this session would
The session will be divided into three parts:
- Introduction to web services
- Introduction to REST
- Using Drupal for RESTful web services
The first part will cover web services in general: what they are, why you'd want to build one, and the various types of web service architectures out there.
The second part will be a description of REST: what it is and why you should use it. It will cover the basic architectural style described by REST and why using REST to build web services can make your life easier.
The third part will show how to create a RESTful web service in Drupal using the REST Provider module.
Note: For those that attended my REST presentation at the Boulder DBUG meeting in May, this is a similar presentation, but it has been revised and expanded. In addition to being more accommodating to those new to web services, it also shows how to implement an actual web service.
| Attachment | Size |
|---|---|
| RESTful Web Services and Drupal.pdf | 1.57 MB |


First, thanks to everyone who
First, thanks to everyone who attended my session at DrupalCamp. More people showed up than I expected and I enjoyed the Q&A/discussion that followed.
I've updated the session to include an attachment to a PDF version of the presentation slides (slightly modified) I used at DrupalCamp. I've also put the slides up at slideshare if you prefer that. (Though the text is a little difficult to read at embedded size, it looks pretty good in full-screen mode.)
Also, a note about the code demo I gave during the presentation: when I was printing out the function argument and getting an array, that was (believe it or not) a feature, not a bug. ;)
I had completely forgotten at the time (I blame a lack of sleep) about the argument passed to all handler functions. The first argument is always an associative array containing the URL, the HTTP method, the headers, and the body of the HTTP request. This information is provided to keep you from having to dig into the
$_GET,$_POST, etc. variables to find out what you need.The documentation for the module will be updated to reflect this. Sorry about any confusion caused by that.