requests
requests copied to clipboard
Weird behaviour with https and proxy authentication
requests.get is getting weird with some combinations of dictionary keys and proxy authentication.
Expected Result
print(requests.get('https://google.com', proxies={"https" : 'https://user:pass@ip:port'}))
Output:
<Response [200]>
Actual Result
Doesn't run? (Maybe timeout) But it somehow fixes itself with these changes
print(requests.get('https://google.com', proxies={"http" : 'http://user:pass@ip:port'}))
Output:
<Response [200]>
Reproduction Steps
import requests
print(requests.get('https://google.com', proxies={"https" : 'https://user:pass@ip:port'}))
print(requests.get('https://google.com', proxies={"http" : 'http://user:pass@ip:port'}))
System Information
$ python -m requests.help
{
"chardet": {
"version": null
},
"charset_normalizer": {
"version": "2.0.12"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "3.4"
},
"implementation": {
"name": "CPython",
"version": "3.10.11"
},
"platform": {
"release": "10",
"system": "Windows"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.27.1"
},
"system_ssl": {
"version": "1010114f"
},
"urllib3": {
"version": "1.26.9"
},
"using_charset_normalizer": true,
"using_pyopenssl": false
}
$ python --version
Python 3.10.11
proxies im using are https capable
misclick
its most likely that your proxies only support http protocol, it should work the way you have it, so its probably proxy issues.
proxies im using are https capable
its most likely that your proxies only support http protocol, it should work the way you have it, so its probably proxy issues.