How to disable proxy while sending api Request

When I am sending api request using UiPath. I am getting 0 as response code. If i disable proxy settings manually then I can Able to get response.
I want to disable proxy using UiPath when sending request. Can anyone help me on that.

Hi @oraganti931

Use invoke code

System.Net.WebRequest.DefaultWebProxy = Nothing

Hope this helps

An alternative for using Invoke code activity is use this in assign activity:

image

// Disable Proxy
Set Registry Value activity → Key Name: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings
→ Value Name: ProxyEnable
→ Value: 0

// Your API Request Here

// Enable Proxy (Optional, if needed afterward)
Set Registry Value activity → Key Name: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings
→ Value Name: ProxyEnable
→ Value: 1