I need to access the rfile and wfile properties of a request handler instance. AFAIK, such a handler is instantiated by the framework during request lifetime.
Update: I found that rfile is accessible through request.environ['wsgi.input']. To access wfile I've do a hack with the additional line in Paste sources, httpserver.py:210:
,'wsgi.outp开发者_如何学JAVAut': self.wfile
But I wonder if there is a better solution...
Better do like this http://pythonpaste.org/webob/reference.html#body-app-iter
In pylons action:
f = response.body_file
f.write('hey')
The response.body_file is only like a file object, but not real stream. For more details read http://www.python.org/dev/peps/pep-0333/#id22
精彩评论