flask get/post参数获取

flask 使用笔记

获得get和post 提交的参数

post 提交参数获取
request.form[‘xxx’] 其类型为:ImmutableMultiDict

1
2
3
4
5
6
@app.route("/deleteInfo", methods=['post'])
@allow_cross_domain
def delete_info():
print(type(request.form))
# < class 'werkzeug.datastructures.ImmutableMultiDict'>
_id = request.form["_id"]

get 提交参数获取

1
2
3
4
@app.route('/queryDetl')
@allow_cross_domain
def query_detail():
_id = request.args.get("_id")