drupal as a restful backend for client side applications

Post on 17-Nov-2014

3.733 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

Arivn Singla's presentation from Drupal Camp Toronto 2012

TRANSCRIPT

Contact us:207-90C Centurian DrMarkham, OntarioL3R 8C5

Arvin Singla@arvinsinglaarvin@myplanetdigital.com

We’re hiring!

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?

top related