C#: How to I extend the timeout of a WebClient call? (30 seconds is just not long enough)
My Azure function is calling web services that take longer than 30 seconds to complete, so I needed to extend the default timeout the WebClient class. I created the following base class: using System; using System.Net; namespace MyHelpers { public class MyWebClient : WebClient { public int Timeout { get; set; } public WebDownload() : this( 180000 ) { } public WebDownload(int timeout) { this.Timeout = timeout; } protected override WebRequest GetWebRequest(Uri address) { var request = base.GetWebRequest(address); if (request != null) { ...