Created
December 5, 2016 15:05
-
-
Save looneym/578e8e9aa754cb4de5dea23b0c5460f1 to your computer and use it in GitHub Desktop.
Get the body of a POST request using Flask
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
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