Skip to content

Instantly share code, notes, and snippets.

@mozz100
Created October 7, 2014 20:37
Show Gist options
  • Save mozz100/8b67ff9c634afcde08fd to your computer and use it in GitHub Desktop.
Save mozz100/8b67ff9c634afcde08fd to your computer and use it in GitHub Desktop.
Tiny python web server that just logs stuff
#!/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