flask 接收参数小坑

前后端分离:

1、get方式:

items = dict(request.args.items())
app_name = items["app_name"].strip()

appn_ame = request.args.get("app_name")  |  appn_ame = request.args["app_name"]

 

2、post方式:

data = request.get_json()
clickurl = data["clickurl"]

 

form或者postman传参:

1、get方式:

items = dict(request.args.items())
app_name = items["app_name"].strip()

appn_ame = request.args.get("app_name") | appn_ame = request.args["app_name"]

 

2、post方式:

username = request.form.get("username") | request.form["username"]

 

posted @ 2019-03-14 09:17  lvmenghui001  阅读(632)  评论(0编辑  收藏  举报