We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Environment: uname -a Linux 6.1.0-25-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.106-3 (2024-08-26) x86_64 GNU/Linux pip list Package Version
certifi 2024.8.30 charset-normalizer 3.3.2 idna 3.8 pip 23.0.1 requests 2.32.3 setuptools 66.1.1 urllib3 2.2.2
Is that normal that the Environment variables: HTTP_PROXY and HTTPS_PROXY would override the proxies argument passed to session.get()?
test code: `import requests import os
#os.environ.pop('https_proxy', None) #os.environ.pop('http_proxy', None)
print(os.environ)
test_url = 'http://httpbin.org/ip'
my_proxies = None
session = requests.Session()
print("=== Session GET with my_proxies ===") response = session.get(url=test_url, proxies=my_proxies)
print(f'Your IP (using my_proxies): {response.json().get("origin")}')`
Run it and you will notice that the session uses the proxy server instead of None (specified by my_proxies = None)
The text was updated successfully, but these errors were encountered:
As described in the template, we won't be able to answer questions on this issue tracker. Please use Stack Overflow
Sorry, something went wrong.
No branches or pull requests
Environment:
uname -a
Linux 6.1.0-25-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.106-3 (2024-08-26) x86_64 GNU/Linux
pip list
Package Version
certifi 2024.8.30
charset-normalizer 3.3.2
idna 3.8
pip 23.0.1
requests 2.32.3
setuptools 66.1.1
urllib3 2.2.2
Is that normal that the Environment variables: HTTP_PROXY and HTTPS_PROXY would override the proxies argument passed to session.get()?
test code:
`import requests
import os
Disable environment proxies temporarily
#os.environ.pop('https_proxy', None)
#os.environ.pop('http_proxy', None)
get all environs
print(os.environ)
Define a test URL (you can replace this with a URL of your choice)
test_url = 'http://httpbin.org/ip'
Define your custom proxies
my_proxies = None
Create a session
session = requests.Session()
Test session.get with explicitly defined proxies
print("=== Session GET with my_proxies ===")
response = session.get(url=test_url, proxies=my_proxies)
Print the result (should reflect the proxy being used)
print(f'Your IP (using my_proxies): {response.json().get("origin")}')`
Run it and you will notice that the session uses the proxy server instead of None (specified by my_proxies = None)
The text was updated successfully, but these errors were encountered: