Skip to content

Instantly share code, notes, and snippets.

@a-h
Last active February 26, 2016 16:15
Show Gist options
  • Select an option

  • Save a-h/6dc2d7ba34124b49e6a6 to your computer and use it in GitHub Desktop.

Select an option

Save a-h/6dc2d7ba34124b49e6a6 to your computer and use it in GitHub Desktop.
Python Web Server to Dump HTTP Post Contents
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