Last active
September 29, 2015 03:04
-
-
Save pistatium/74891d228d6e2f12b39c to your computer and use it in GitHub Desktop.
リクエストされたHeaderとBodyを標準出力とレスポンスに書き出すスクリプト
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
# coding: utf-8 | |
import tornado.ioloop | |
import tornado.web | |
class MainHandler(tornado.web.RequestHandler): | |
def post(self): | |
print("Header---------") | |
print(self.request.headers) | |
print("Body-----------") | |
print(self.request.body) | |
self.write({"headers": self.request.headers, "body": self.request.body}) | |
application = tornado.web.Application([ | |
(r"/", MainHandler), | |
]) | |
if __name__ == "__main__": | |
application.listen(10000) | |
tornado.ioloop.IOLoop.current().start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment