Created
August 7, 2010 20:45
-
-
Save leeola/513185 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RESTfulPOSTRequestHandler(RequestHandler): | |
'''A RESTful way to handle POST form data.''' | |
def dispatch(self, method, **kwargs): | |
'''Upon any POST requests this class simply looks for a "method" | |
field, and if found, returns the appropriate response.''' | |
if (method == 'post' and self.request.form.has_key('method') and | |
self.request.form['method']): | |
method = str(self.request.form['method']).lower() | |
return super(RESTfulPOSTRequestHandler, self).dispatch(method, **kwargs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment