Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何在flask中取消浏览URL?_Python_Url_Flask_Werkzeug - Fatal编程技术网

Python 如何在flask中取消浏览URL?

Python 如何在flask中取消浏览URL?,python,url,flask,werkzeug,Python,Url,Flask,Werkzeug,当我使用参数egapp.route(“/index?status=”)返回索引时,为什么URL会在浏览器端转义 http://127.0.0.1:5000/index%3Fstatus%3Dfalse 或者,更接近我的问题,我如何取消URL的搜索?我在烧瓶里能做什么?我在Flask和Werkzeug上搜索了一下,但什么也没找到……不要把查询字符串放在路由中。而是使用request.args.get访问它们 @app.route('/index') if 'status' in reque

当我使用参数eg
app.route(“/index?status=”)
返回索引时,为什么URL会在浏览器端转义

http://127.0.0.1:5000/index%3Fstatus%3Dfalse


或者,更接近我的问题,我如何取消URL的搜索?我在烧瓶里能做什么?我在Flask和Werkzeug上搜索了一下,但什么也没找到……

不要把查询字符串放在路由中。而是使用request.args.get访问它们

@app.route('/index')
    if 'status' in request.args:
        status = request.args.get('status')