1. 程式人生 > >通過flask的request物件獲取url

通過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/