63
Presented by Greg Hines

RESTful Web Services and Drupal

Embed Size (px)

DESCRIPTION

A presentation about RESTful web services and using Drupal as a platform for creating them.

Citation preview

Page 1: RESTful Web Services and Drupal

Presented by Greg Hines

Page 2: RESTful Web Services and Drupal
Page 3: RESTful Web Services and Drupal
Page 4: RESTful Web Services and Drupal
Page 5: RESTful Web Services and Drupal

E.g. SOAP, XML-RPC

Page 6: RESTful Web Services and Drupal

E.g. REST

Page 7: RESTful Web Services and Drupal
Page 8: RESTful Web Services and Drupal
Page 9: RESTful Web Services and Drupal

REST itself isn’t complicated.Defining REST is.

Page 10: RESTful Web Services and Drupal
Page 11: RESTful Web Services and Drupal

Yet.

Page 12: RESTful Web Services and Drupal
Page 13: RESTful Web Services and Drupal
Page 14: RESTful Web Services and Drupal
Page 15: RESTful Web Services and Drupal
Page 16: RESTful Web Services and Drupal
Page 17: RESTful Web Services and Drupal
Page 18: RESTful Web Services and Drupal
Page 19: RESTful Web Services and Drupal
Page 20: RESTful Web Services and Drupal
Page 21: RESTful Web Services and Drupal
Page 22: RESTful Web Services and Drupal
Page 23: RESTful Web Services and Drupal
Page 24: RESTful Web Services and Drupal
Page 25: RESTful Web Services and Drupal
Page 26: RESTful Web Services and Drupal

• A blog post• A collection of blog posts• An image• A user• Map coordinates• A bank transaction• Search results

Page 27: RESTful Web Services and Drupal
Page 28: RESTful Web Services and Drupal

Every resource has at least one URI;every URI points to a resource.

http://example.com/blog/2008/05/14/restful-web-services-and-drupal

http://example.com/blog/2008/05

http://example.com/

Page 29: RESTful Web Services and Drupal
Page 30: RESTful Web Services and Drupal
Page 31: RESTful Web Services and Drupal
Page 32: RESTful Web Services and Drupal

Response Codes– 200 OK– 404 Not Found– 500 Internal Server Error

There are 39 response codes (plus two not in current use)

Page 33: RESTful Web Services and Drupal
Page 34: RESTful Web Services and Drupal

• HTTP is stateless by design

Page 35: RESTful Web Services and Drupal

• HTTP is stateless by design• Every HTTP request happens in isolation

Page 36: RESTful Web Services and Drupal

• HTTP is stateless by design• Every HTTP request happens in isolation• There are two kinds of state in a RESTful web service…

Page 37: RESTful Web Services and Drupal
Page 38: RESTful Web Services and Drupal
Page 39: RESTful Web Services and Drupal
Page 40: RESTful Web Services and Drupal
Page 41: RESTful Web Services and Drupal
Page 42: RESTful Web Services and Drupal
Page 43: RESTful Web Services and Drupal

Resources link to each other:

<a href="http://example.com/resource/3">...</a>

Page 44: RESTful Web Services and Drupal

Resources link to each other:

<a href="http://example.com/resource/3">...</a>

<link rel="alternate" type="application/atom+xml" href="http://example.com/resource/2.atom" />

Page 45: RESTful Web Services and Drupal

Resources link to each other:

<a href="http://example.com/resource/3">...</a>

<link rel="alternate" type="application/atom+xml" href="http://example.com/resource/2.atom" />

<?xml version="1.0" encoding="UTF-8"?><resource xmlns="http://example.com/ns/resource"> <content>...</content> <nextResource href="http://example.com/resource/3"/> <prevResource href="http://example.com/resource/1"/></resource>

Page 46: RESTful Web Services and Drupal
Page 47: RESTful Web Services and Drupal
Page 48: RESTful Web Services and Drupal
Page 49: RESTful Web Services and Drupal
Page 50: RESTful Web Services and Drupal

(Sort of.)

Page 51: RESTful Web Services and Drupal

An appeal to authority or argument by authority is a type of argument in logic consisting on basing the truth value of an assertion on the authority, knowledge, expertise, or position of the person asserting it.

–Wikipedia

Page 52: RESTful Web Services and Drupal

• Co-founder, chairman of the Apache Software Foundation• Co-founder of the Apache HTTP Project• On IETF working groups for HTTP, URI, and HTML– Architectural principal on HTTP working group – First name on HTTP spec

• Originator of REST

Page 53: RESTful Web Services and Drupal
Page 54: RESTful Web Services and Drupal
Page 55: RESTful Web Services and Drupal

• User Management

Page 56: RESTful Web Services and Drupal

• User Management• Resource Management

Page 57: RESTful Web Services and Drupal

• User Management• Resource Management• Routing

Page 58: RESTful Web Services and Drupal
Page 59: RESTful Web Services and Drupal

• Multiple Representations for Resources

Page 60: RESTful Web Services and Drupal

• Multiple Representations for Resources• Content Negotiation

Page 61: RESTful Web Services and Drupal
Page 62: RESTful Web Services and Drupal
Page 63: RESTful Web Services and Drupal