flask 获取request对象的内容(flask 6)

2019-08-13 14:31:26 浏览数 (1)

from flask import Flask,request

app = Flask(name)

@app.route("/req") def getreq(): name=request.args.get('name','flask') agent=request.user_agent headers=request.headers method=request.method referer=request.referrer scheme=request.scheme data=request.data cookies=request.cookies path=request.path full_path=request.full_path host=request.host url=request.url return "aaa"

if name == 'main': app.run( host='0.0.0.0', port=8888, debug=True )

0 人点赞