requests使用“proxy”代理访问接口

在requests中使用proxy代理访问

使用前先更新requests版本为支持socks的版本。
 
先pip安装对应库: 
>> pip install -U requests[socks]
 
脚本添加和使用代理:
 
import requests
....
proxy = {
}
....
# 使用代理发送请求
....
ret = requests.post(url, json=params, proxies=proxy).content
....
原文地址:https://www.cnblogs.com/ailiailan/p/10515159.html