Created
October 7, 2014 20:37
-
-
Save mozz100/8b67ff9c634afcde08fd to your computer and use it in GitHub Desktop.
Tiny python web server that just logs stuff
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
#!/usr/bin/env python | |
import tornado.ioloop | |
import tornado.web | |
import pprint | |
class MyDumpHandler(tornado.web.RequestHandler): | |
def post(self): | |
pprint.pprint("Request") | |
pprint.pprint(self.request) | |
pprint.pprint("Body") | |
pprint.pprint(self.request.body) | |
if __name__ == "__main__": | |
tornado.web.Application([(r"/.*", MyDumpHandler),]).listen(8080) | |
tornado.ioloop.IOLoop.instance().start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment