Retry HTTP request from .NET with different proxy server
问题 I can issue HTTP requests through a proxy in a .NET app. There are a number of proxy servers I can use and sometimes one or more will go down. How can I have my app retry the HTTP request using a different proxy? I am open to any suggestion and have heard good things about Polly for adding resiliency. 回答1: If you were to use Polly, maybe something like this: public void CallGoogle() { var proxyIndex = 0; var proxies = new List<IWebProxy> { new WebProxy("proxy1.test.com"), new WebProxy("proxy2