Answer the question
In order to leave comments, you need to log in
How to make https request in python 3.4 through proxy?
I need to make an https request (GET and POST) to the server through a proxy (HTTP, SOCKS5) or without them. urllib does not support SOCKS5 requests. Httplib2 doesn't want to work through a proxy at all. What other options will there be?
Answer the question
In order to leave comments, you need to log in
If you don't mind third party libraries, try requests.
import requests
proxies = {
"http": "http://10.10.1.10:3128",
"https": "http://10.10.1.10:1080",
}
requests.get("https://example.org", proxies=proxies)
There is a fork of a relatively old version of requests that can work with SOCKS proxies - requesocks .
In the future, this functionality should migrate to requests.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question