Http request through proxies

Hello,

Is there anyway to make an http request through proxy server, then getting response in JSON ?!!

Check this documentation Redirecting Robots through a Proxy Server

Thnx for your repl, But i need to redirect only specific requests not the whole robot.
for example: i want only connect to “google.com” through a proxy server, then completing automation as normal !!

The actual HTTP Request activity is not having the such feature.

You can create a custom code and invoke it in UiPath Studio.

Or check internally if the Network team can redirect your specific request to a proxy.

I created this python code, But still doesn’t redirect requests to the given proxy server while no errors exists. Do you know what is wrong with it ?!

import urllib.request as req

proxy = req.ProxyHandler({'http': r'UserName:pass@URL:Port'})
auth = req.HTTPBasicAuthHandler()
opener = req.build_opener(proxy, auth, req.HTTPHandler)
req.install_opener(opener)
conn = req.urlopen('https://google.com')
return_str = conn.read()
return_str = str(return_str)
print (return_str)

Anyone knows what is wrong with this Python code:

import urllib.request as req

proxy = req.ProxyHandler({'http': r'UserName:pass@URL:Port'})
auth = req.HTTPBasicAuthHandler()
opener = req.build_opener(proxy, auth, req.HTTPHandler)
req.install_opener(opener)
conn = req.urlopen('https://google.com')
return_str = conn.read()
return_str = str(return_str)
print (return_str)

Code doesn’t through any errors, But still not using the provided proxy. It only initiates request to google from my host machine not from the proxy server ! How could i make it redirect requests to google through the given proxy server?!