changeset 35:d95ac066cb62

example/persona.py
author Jeff Hammel <jhammel@mozilla.com>
date Fri, 27 Dec 2013 13:45:10 -0800
parents 119cf9c81d3d
children afeb01315ab6
files example/persona.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/example/persona.py	Fri Dec 27 13:43:43 2013 -0800
+++ b/example/persona.py	Fri Dec 27 13:45:10 2013 -0800
@@ -21,7 +21,8 @@
         assert os.path.exists(self.page), "File '%s' not found" % self.page
         self.page = open(self.page, 'r').read()
     def __call__(self, environ, start_response):
-        method = environ['REQUEST_METHOD']
+        request = Request(environ)
+        method = request.method
         if method == 'GET':
             content_type = 'text/html'
             body = self.page
@@ -29,7 +30,6 @@
             content_type = 'text/plain'
             body = '\n'.join(['%s: %s' % (key, environ[key])
                               for key in sorted(environ.keys())])
-            print body
         else:
             content_type = 'text/plain'
             body = 'Try GET or POST to do something interesting (How did you get here?)'