首先让requests请求使用代理,使用如下参数进行设定:
import requests
headers = {
'device_sn':'FwgRiO7CNA50DSU',
"os_platform": "ios",
"app_version":'2.8.6',
}
json = {
'sign': '9c0c7e51c91ae963c833a4ccbab8d683c4a90c98'
}
proxies = {
'http':'http://127.0.0.1:8888',
'https':'http://127.0.0.1:8888',
}
response = requests.post('http://192.168.1.107:5000/api/get-token',
headers = headers,
json=json,
proxies = proxies)
print(response.text)
然后,在Fiddler中抓取到的包如下所示:
在Fiddler左侧选中该条http请求后,File->Export Sessions->Selected Sessions,选择har格式,便可。