1、fiddler抓包pycharm失敗
原來的代碼:
r = requests.post(url, data)
此時發送的請求fiddler抓取不了數據
修改為:
fiddler_proxies = {'http': 'http://127.0.0.1:8080', 'https': 'http://127.0.0.1:8080'} # 避免fiddler抓不到請求數據而設置的
r = requests.post(url, data, proxies=fiddler_proxies, verify=False) # verify和proxies均是為了可以正常使用fiddler抓而設
再次嘗試,可以正常抓包,但是有警告:InsecureRequestWarning: Unverified HTTPS request is being made to host '127.0.0.1'. Adding certificate verification is strongly advised. See
2、解決警告:InsecureRequestWarning: Unverified HTTPS request is being made to host '127.0.0.1'. Adding certificate verification is strongly advised. See
在發送請求前,添加代碼,如下:
fiddler_proxies = {'http': 'http://127.0.0.1:8080', 'https': 'http://127.0.0.1:8080'} # 避免fiddler抓不到請求數據而設置的 # 取消警告:InsecureRequestWarning: Unverified HTTPS request is being made to host '127.0.0.1'. Adding certificate verification is strongly advised. See requests.packages.urllib3.disable_warnings(InsecureRequestWarning) r = requests.post(url, data, proxies=fiddler_proxies, verify=False) # verify和proxies均是為了可以正常使用fiddler抓而設