You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
798 B
26 lines
798 B
using System.Net;
|
|
using System.Net.Cache;
|
|
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
|
|
};
|
|
}
|
|
}
|
|
}
|