diff wsgraph/web.py @ 2:7a3b21cafc00

start to sketch out REST API
author Jeff Hammel <jhammel@mozilla.com>
date Sun, 09 Dec 2012 10:40:17 -0800
parents cfcfa093e4b4
children 42f484880808
line wrap: on
line diff
--- a/wsgraph/web.py	Sun Dec 09 10:25:50 2012 -0800
+++ b/wsgraph/web.py	Sun Dec 09 10:40:17 2012 -0800
@@ -2,12 +2,6 @@
 
 """
 web handler for WSGraph
-
-Formatters are keyed off of:
-- (TODO)
-
-formatters = {0: {
-}
 """
 
 import json
@@ -46,7 +40,19 @@
     # HTTP methods
 
     def GET(self, request):
-        """respond to a GET request"""
+        """
+        respond to a GET request
+
+        Formatters are keyed off of
+
+        formatters = {0: {
+        }
+
+        API:
+
+        ?format=<format>
+
+        """
 
         segments = self.path_segments(request)
 
@@ -56,8 +62,15 @@
                         body="WSGraph")
 
     def POST(self, request):
-        """respond to a POST request"""
-        raise NotImplementedError
+        """
+        respond to a POST request
+
+        API:
+
+        ?update :
+        """
+
+        return exc.HTTPSeeOther('/') # TODO: /path/to/self
 
     def HEAD(self, request):
         """respond to a HEAD request"""