# HG changeset patch # User Jeff Hammel # Date 1388180710 28800 # Node ID d95ac066cb6208b6b7a3b6422fa796a4288dadce # Parent 119cf9c81d3d25950025faaaf0022d3575300d26 example/persona.py diff -r 119cf9c81d3d -r d95ac066cb62 example/persona.py --- 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?)'