Skip to content

Instantly share code, notes, and snippets.

@jkpl
Created April 6, 2016 12:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jkpl/81af3c25b91387b75791cfb32a0649e8 to your computer and use it in GitHub Desktop.
Save jkpl/81af3c25b91387b75791cfb32a0649e8 to your computer and use it in GitHub Desktop.
Dump incoming POST requests to STDOUT
#!/usr/bin/env python
import tornado.ioloop
import tornado.web
import pprint
class MyDumpHandler(tornado.web.RequestHandler):
def post(self):
pprint.pprint(self.request)
pprint.pprint(self.request.body)
if __name__ == "__main__":
tornado.web.Application([(r"/.*", MyDumpHandler),]).listen(9000)
tornado.ioloop.IOLoop.instance().start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment