通过flask的request对象获取url

测试了一下:通过发送 GET 到 http://127.0.0.1:5000/test/a?x=1,

后台输出为(官网说明):

1 request.path: /test/a
2 request.host: 127.0.0.1:5000
3 request.host_url: http://127.0.0.1:5000/
4 request.full_path: /test/a?x=1
5 request.script_root: 
6 request.url: http://127.0.0.1:5000/test/a?x=1
7 request.base_url: http://127.0.0.1:5000/test/a
8 request.url_root: http://127.0.0.1:5000/

猜你喜欢

转载自www.cnblogs.com/lyg-blog/p/10049086.html
今日推荐