DNF新年套

python_flask 基础巩固 (URL传输传递方式)

URL传输传递
@app.route('/'):
@app.route('/list/')
@app.route('/list/<int:id>/')
@app.route('/list/<string:id>/')
@app.route('/list/<float:id>/')
@app.route('/list/<path:id>/')
@app.route('/list/<uuid:id>/')
*any 多个请求访问一个函数。
@app.route('/<any(my/you):list>/<uuid:id>/')
def xx(list,id):
if ...:
else:
通过问号形式获取参数
x = request.args.get('bd')

posted on 2018-04-13 15:24  DNF新年套  阅读(378)  评论(0)    收藏  举报

导航