I want to make an API call (outside my organization domain) in my existing application, the network team has told me to set up a proxy config - only then it'd have the ability to go to the internet. Dev has the ability to go to the internet without referencing the proxy setup.
In my dev environment, it is working fine since the ports are open, how to configure a proxy for UAT environment so that it can hit the new target on the internet? proxy IP is given by the network team for Non-prod: 12.XXX.XXX.0 Port 80
and also how to check:
The HttpWebRequest
has a proxy property:
var myWebRequest = (HttpWebRequest)WebRequest.Create("url");
myWebRequest.Proxy = new WebProxy("host", 80);
try
{
var response = myWebRequest.GetResponse();
//...
}
catch (WebException e)
{
// handling issues
}
If a request fails, an exception will be thrown that you can handle in catch
block.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.