The only way I'm currently aware of for disabling proxies entirely is the following:
- Create a session
- Set session.trust_env to False
- Create your request using that session
import requests
session = requests.Session()
session.trust_env = False
url = "xxxxx"
response = session.get(url)
If however you only want to disable proxies for a particular domain (like localhost), you can use the NO_PROXY environment variable:
import os
import requests
os.environ['NO_PROXY'] = 'qq.com'
response = requests.get('http://www.qq.com')
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。