Created
December 4, 2018 11:18
-
-
Save cutoffthetop/cb65a1df96a53494aa9a8b87ad626394 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tornado.ioloop | |
import tornado.web | |
import pprint | |
class Echo(tornado.web.RequestHandler): | |
def get(self, *args, **kw): | |
data = self.request.__dict__.copy() | |
data.pop('server_connection') | |
data.pop('connection') | |
data['headers'] = dict(data['headers']) | |
self.write(pprint.pformat(data, indent=2)) | |
if __name__ == '__main__': | |
app = tornado.web.Application([(r'/.'", Echo)]) | |
app.listen(8888) | |
tornado.ioloop.IOLoop.current().start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment