diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-11-30 01:07:25 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-11-30 01:07:25 -0500 |
| commit | 0bdc8a49d5ea17417b3552d6db21239190bc4b6b (patch) | |
| tree | acf68343f6645bb57ad39ede2e24c9520b64dd90 /MediaBrowser.ServerApplication/Native/HttpClientFactory.cs | |
| parent | 9b9e5fc4e48aa8d2595691b5cf0c3354f723726a (diff) | |
switch from httpclient to plain httpwebrequest
Diffstat (limited to 'MediaBrowser.ServerApplication/Native/HttpClientFactory.cs')
| -rw-r--r-- | MediaBrowser.ServerApplication/Native/HttpClientFactory.cs | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/MediaBrowser.ServerApplication/Native/HttpClientFactory.cs b/MediaBrowser.ServerApplication/Native/HttpClientFactory.cs deleted file mode 100644 index 368c60254..000000000 --- a/MediaBrowser.ServerApplication/Native/HttpClientFactory.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Net; -using System.Net.Cache; -using System.Net.Http; - -namespace MediaBrowser.ServerApplication.Native -{ - /// <summary> - /// Class HttpClientFactory - /// </summary> - public static class HttpClientFactory - { - /// <summary> - /// Gets the HTTP client. - /// </summary> - /// <param name="enableHttpCompression">if set to <c>true</c> [enable HTTP compression].</param> - /// <returns>HttpClient.</returns> - public static HttpClient GetHttpClient(bool enableHttpCompression) - { - var client = new HttpClient(new WebRequestHandler - { - CachePolicy = new RequestCachePolicy(RequestCacheLevel.Revalidate), - AutomaticDecompression = enableHttpCompression ? DecompressionMethods.Deflate : DecompressionMethods.None - - }) - { - Timeout = TimeSpan.FromSeconds(20) - }; - - client.DefaultRequestHeaders.Add("Connection", "Keep-Alive"); - - return client; - } - } -} |
