My python version is 3.4, my tornado version is 4.3.My code is like this:
import tornado.ioloop
import tornado.web
import tornado.httputil
import tornado.httpserver
class MainHandler(tornado.web.RequestHandler):
def get(self):
body = 'foobar'*10
self.set_header('Transfer-Encoding', 'chunked')
self.write(body)
self.flush()
self.finish()
app = tornado.web.Application([
(r'/chunked', MainHandler),
])
if __name__ == "__main__":
app.listen(8080)
tornado.ioloop.IOLoop.current().start()
This simply can not work, client just wait for the chunk ends.How to generate a chunked response properly when using tornado server?