コード例 #1
0
 public HttpClientWrapper(
     HttpClient httpClient,
     Uri host,
     HttpClientSettings httpClientSettings)
     : base(typeof(T), httpClient, host, httpClientSettings)
 {
 }
コード例 #2
0
        public virtual HttpMessageInvoker GetClient(HttpClientSettings clientSetting, params DelegatingHandler[] handlers)
        {
            HttpClient httpClient = null;

            if (clientSetting.AutomaticDecompression)
            {
                var internalHandler = new HttpClientHandler()
                {
                    AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate
                };
                httpClient = HttpClientFactory.Create(internalHandler, handlers);
            }
            else
            {
                httpClient = HttpClientFactory.Create(handlers);
            }

            httpClient.Timeout = clientSetting.Timeout;

            return(httpClient);
        }
コード例 #3
0
 public HttpClientWrapperFactory()
 {
     HttpClientSettings = new HttpClientSettings();
     HttpClientProvider = new DefaultHttpClientProvider();
 }
コード例 #4
0
 public EasyClientConfig()
 {
     HttpClientSettings = new HttpClientSettings();
     HttpClientProvider = new DefaultHttpClientProvider();
 }