Answers for "c# httpClient timeout"

C#
1

set request timeout c#

<system.web>
     <httpRuntime executionTimeout="600"/>
 </system.web>
Posted by: Guest on August-29-2020
0

WebClient timeout

private class WebClient : System.Net.WebClient
    {
        public int Timeout { get; set; }

        protected override WebRequest GetWebRequest(Uri uri)
        {
            WebRequest lWebRequest = base.GetWebRequest(uri);
            lWebRequest.Timeout = Timeout;
            ((HttpWebRequest)lWebRequest).ReadWriteTimeout = Timeout;
            return lWebRequest;
        }
    }

    private string GetRequest(string aURL)
    {
        using (var lWebClient = new WebClient())
        {
            lWebClient.Timeout = 600 * 60 * 1000;
            return lWebClient.DownloadString(aURL);
        }
    }
Posted by: Guest on May-31-2020
0

c# restclient timeout

var client = new RestClient(BaseUrl);
client.Timeout = 5000; // 5000 milliseconds == 5 seconds
Posted by: Guest on February-04-2021

Code answers related to "c# httpClient timeout"

C# Answers by Framework

Browse Popular Code Answers by Language