赞
踩
- from flask import Flask, request, Response
- import json
-
- app = Flask(__name__)
-
- @app.route('/redata',methods=['GET','POST'])
- def hello_world():
- if request.method == 'GET':
- verify=request.args.get('verify','')
- return verify
- else:
- # data=json.loads(request.get_data(as_text=True))
- print(request.headers)
- print(request.json)
- result='{"body": null, "status": 200}'
- return Response(result,mimetype='application/json')
-
-
-
数据推送地址:http://127.0.0.1:5000/dedata
flask run --host=0.0.0.0 --port=5000 #实现外网功能
赞
踩
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。