Skip to content

Instantly share code, notes, and snippets.

@looneym
Created December 5, 2016 15:05
Show Gist options
  • Save looneym/578e8e9aa754cb4de5dea23b0c5460f1 to your computer and use it in GitHub Desktop.
Save looneym/578e8e9aa754cb4de5dea23b0c5460f1 to your computer and use it in GitHub Desktop.
Get the body of a POST request using Flask
from flask import Flask, request
app = Flask(__name__)
@app.route('/', methods=['POST'])
def get_body():
req = request.get_data()
print req
return req
if __name__ == '__main__':
app.run(debug=True, port=5000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment