A straightforward use of a series of request.write()s with a request.finish() in the render_GET() method of a resource defaults to chunked encoding.  I can avoid the chunked encoding by computing the entire response first using a StringIO (as shown below) and explicitly putting the &quot;Content-Length&quot; header in myself.<div>
<br></div><div>Is this the best (or recommended) way to create such a response?</div><div><br></div><div>Thx - Tom</div><div><br></div><div>=============</div><div><br></div><div>class myresource(Resource):</div><div><br>
</div><div>  def render_GET(self, response):</div><div>    output = StringIO.StringIO()</div><div>    output.write(&quot;...&quot;)</div><div>    output.write(&quot;...&quot;)</div><div>    ...</div><div><br></div><div>    data = output.getvalue()</div>
<div>    output.close()</div><div><br></div><div>    # Write the response data.  &quot;content-length&quot; suppresses chunked coding</div><div><div>    request.setHeader(&#39;content-length&#39;, len(data))</div><div>    request.write(data)</div>
<div>    request.finish()</div><div>    return True</div></div><div><br></div>