diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-10-02 13:05:13 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-10-02 13:05:13 -0400 |
| commit | bb4c918bf8403b2058f5fbbf2c0b1943b4b5f327 (patch) | |
| tree | 1c14879511e69a5a989ccf95f2de491f5b3eb9d2 /MediaBrowser.Server.Mono/Native | |
| parent | 9f8a1b30a1ecec0af3c48bcb30e035938f93218c (diff) | |
refactor http client factory for mono
Diffstat (limited to 'MediaBrowser.Server.Mono/Native')
| -rw-r--r-- | MediaBrowser.Server.Mono/Native/HttpClientFactory.cs | 24 | ||||
| -rw-r--r-- | MediaBrowser.Server.Mono/Native/HttpMessageHandlerFactory.cs | 24 |
2 files changed, 24 insertions, 24 deletions
diff --git a/MediaBrowser.Server.Mono/Native/HttpClientFactory.cs b/MediaBrowser.Server.Mono/Native/HttpClientFactory.cs new file mode 100644 index 000000000..0fceab060 --- /dev/null +++ b/MediaBrowser.Server.Mono/Native/HttpClientFactory.cs @@ -0,0 +1,24 @@ +using System; +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) + { + return new HttpClient() + { + Timeout = TimeSpan.FromSeconds(20) + }; + } + } +} diff --git a/MediaBrowser.Server.Mono/Native/HttpMessageHandlerFactory.cs b/MediaBrowser.Server.Mono/Native/HttpMessageHandlerFactory.cs deleted file mode 100644 index 627218a01..000000000 --- a/MediaBrowser.Server.Mono/Native/HttpMessageHandlerFactory.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Net; -using System.Net.Http; - -namespace MediaBrowser.ServerApplication.Native -{ - /// <summary> - /// Class HttpMessageHandlerFactory - /// </summary> - public static class HttpMessageHandlerFactory - { - /// <summary> - /// Gets the HTTP message handler. - /// </summary> - /// <param name="enableHttpCompression">if set to <c>true</c> [enable HTTP compression].</param> - /// <returns>HttpMessageHandler.</returns> - public static HttpMessageHandler GetHttpMessageHandler(bool enableHttpCompression) - { - return new HttpClientHandler - { - AutomaticDecompression = enableHttpCompression ? DecompressionMethods.Deflate : DecompressionMethods.None - }; - } - } -} |
