April 19, 2012
5:20 p.m.
On Thu, Apr 19, 2012 at 15:37, Tom Sheffler <tom.sheffler@gmail.com> wrote:
Is this the best (or recommended) way to create such a response?
I don't think there's any need to close your StringIO. You can also use cStringIO.StringIO for better performance. And you can just return a string from your render_GET. So, like this (untested): def render_GET(self, response): output = cStringIO.StringIO() output.write("...") output.write("...") return output.getvalue() Ivan