My favorites | Sign in
Project Home Wiki Issues Source
Search
for
Restify  
Designing RESTful web services, step by step
Featured
Updated Feb 4, 2010 by stuhlmue...@gmail.com

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 (models.py) -- usually: What's stored in the DB
  2. Define resources and give them URIs (urls.py) -- 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 (views.py) -- function or Class.__call__ that takes URL parameters and returns a HttpResponse

Sign in to add a comment
Powered by Google Project Hosting