from flask import Flask,request,jsonify
app = Flask(__name__)
@app.route('/', methods = ['POST'])
def index():
data = request.get_json()
# 你可以在这里处理请求数据,例如:
# if data['key'] == 'value':
# return '参数正确!'
# else
# return '参数错误!'
return jsonify({'result': 'success'})
if __name__ == '__main__':
app.run(debug=True)
标签:__,return,请求,flask,app,获取,Flask,data From: https://www.cnblogs.com/full-stack-linux-new/p/17855922.html