using System.Net; using System.Net.Cache; using System.Net.Http; namespace MediaBrowser.ServerApplication.Native { /// /// Class HttpMessageHandlerFactory /// public static class HttpMessageHandlerFactory { /// /// Gets the HTTP message handler. /// /// if set to true [enable HTTP compression]. /// HttpMessageHandler. public static HttpMessageHandler GetHttpMessageHandler(bool enableHttpCompression) { return new WebRequestHandler { CachePolicy = new RequestCachePolicy(RequestCacheLevel.Revalidate), AutomaticDecompression = enableHttpCompression ? DecompressionMethods.Deflate : DecompressionMethods.None }; } } }