My favorites | Sign in
Project Home Wiki Issues Source
Designing RESTful web services, step by step
Updated Feb 4, 2010 by

General procedure (from "RESTful Web Services" by Leonard Richardson and Sam Ruby):

  1. Figure out the data set
  2. Split the data set into resources; for each kind of resource:
  3. Name the resources with URIs
  4. Expose a subset of the uniform interface (GET, PUT, DELETE, POST, HEAD)
  5. Design the representation(s) accepted from the client (see below)
  6. Design the representation(s) served to the client (see below)
  7. Integrate this resource into existing resources, using hypermedia links and forms
  8. Consider the typical course of events: what’s supposed to happen?
  9. Consider error conditions: what might go wrong?

RESTful web services with Django (cf. Jacob Kaplan-Moss, "RESTful Web Services"):

  1. Create the data model ( -- usually: What's stored in the DB
  2. Define resources and give them URIs ( -- not every Django model is a resource; you might for example not want to expose user accounts as a resource
  3. Implement resources as Django views ( -- function or Class.__call__ that takes URL parameters and returns a HttpResponse

Sign in to add a comment
Powered by Google Project Hosting