drupal as a restful backend for client side applications
DESCRIPTION
Arivn Singla's presentation from Drupal Camp Toronto 2012TRANSCRIPT
11/16/12
Drupal As A RESTful Backend
For Client Side Applications
Getourselves arRESTed
REpresentational State Transfer
• Architectural Style– Many ways to implement
• 5 Primary Constraints to be considered “RESTful”– Client / Server– Stateless– Cacheable– Layered System– Uniform Interface
wRESTling
with the web
Why do we REST?
• Client side and Mobile Applications– Apps load fast, data comes after– Local caching
• API data access– Allow others to use your data
RESTful Web API
• Web service implemented using HTTP and the principles of REST
• Clients interact with RESTful servers over HTTP methods– Create (POST)– Read (GET)– Update (PUT)– Delete (DELETE)
RESTrainyourself fromthe excitement!
Services Module (3.x)
– Creates URL callback endpoints for integrating external applications
– Supports multiple interfaces including REST, XMLRPC, JSON, JSON-RPC, SOAP, AMF, etc.
Services Module (3.x)
– Supports Drupal core resources, third party integration is done with modules
– Authentication and OAUTH support
– Performs a full bootstrap :(
– Caching in 7.x-dev YAY! (Issue #1791978)
Services Endpoints
Create: POST/[endpoint_path]/[resource] + bodyRetrieve: GET/[endpoint_path]/[resource]/[resource_id]Update: PUT/[endpoint_path]/[resource]/[resource_id] + bodyDelete: DELETE/[endpoint_path]/[resource]/[resource_id]
Demo time!
cRESTing towards the future
Drupal 8: The Promise Land
• WSCCI: Web Services and Context Core Initiative– Utilizing Symfony 2 HTTP services– Native RESTful services baked into
Core
qRESTions?