我在 stackoverflow 上找到了这篇文章:
How do I get the different parts of a Flask request's url?
我们可以像这样获取请求的不同部分:
With this URL :
http://www.example.com/myapplication/page.html?x=y
We can get these values :
path /page.html
script_root /myapplication
base_url http://www.example.com/myapplication/page.html
url http://www.example.com/myapplication/page.html?x=y
url_root http://www.example.com/myapplication/
有没有办法在字符串中获取最后一部分(参数)?
--> 得到这个:?x=y
谢谢 !
相关分类