Python Forum

Full Version: send requests to URL with proxy
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello
I want to send a POST/GET request to an URL
I use from Requests module and create a Session
and send my requests with this session

Please help me to send this request with a Proxy (proxy is annonymouse and without user/pass)

I Test these three way but can't get answer (Of course maybe I made a mistake!)
Way 1:
session.proxies = {pr: ip + ":" + port}
Way 2:
proxy = {pr: ip + ":" + port}
s = session.post(link, data, proxies=proxy, headers=head)
Way 3:
req = requests.Request('POST', link, data=data, headers=head)
prepped = req.prepare()
resp = session.send(prepped, proxies=proxy)
Please help me or say to me a different way
Thanks a lot