Last active
February 26, 2016 16:15
-
-
Save a-h/6dc2d7ba34124b49e6a6 to your computer and use it in GitHub Desktop.
Python Web Server to Dump HTTP Post Contents
This file contains hidden or 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 flask | |
| app = flask.Flask(__name__) | |
| @app.route("/", methods=['GET', 'POST']) | |
| def hello(): | |
| print("Headers") | |
| for header in flask.request.headers: | |
| print(str.format("{0}:{1}", header[0], header[1])) | |
| print(str.format("Querystring: {0}", flask.request.query_string)) | |
| print(str.format("Post: {0}", flask.request.get_data())) | |
| return flask.request.get_data() | |
| if __name__ == "__main__": | |
| app.debug = True | |
| app.run(host='0.0.0.0', port=8080) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment