HttpClientHandler.AutomaticDecompression Property

Definition

Gets or sets the type of decompression method used by the handler for automatic decompression of the HTTP content response.

public:
 property System::Net::DecompressionMethods AutomaticDecompression { System::Net::DecompressionMethods get(); void set(System::Net::DecompressionMethods value); };
public System.Net.DecompressionMethods AutomaticDecompression { get; set; }
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public System.Net.DecompressionMethods AutomaticDecompression { get; set; }
member this.AutomaticDecompression : System.Net.DecompressionMethods with get, set
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
member this.AutomaticDecompression : System.Net.DecompressionMethods with get, set
Public Property AutomaticDecompression As DecompressionMethods

Property Value

The automatic decompression method used by the handler.

Attributes

Remarks

Automatic decompression works only on the top most compression. So if the content is compressed multiple times, only the last compression will be decompressed. For example, for a response with Content-Encoding: gzip, br header that contains content first compressed with gzip and then with Brotli, the content will only be decompressed using Brotli, leaving the still gzipped content in the Content.

Setting automatic decompression to anything other than None will result in adding Accept-Encoding header with the set values into every outgoing HttpRequestMessage.

For the .NET Framework 4.x System.Net.Http binary in the Global Assembly Cache (GAC), the default value is None.

When the System.Net.Http NuGet package v4.1.0 to v4.3.2 is used, the default is GZip and Deflate.

After NuGet package v4.3.2, the default value of None is used.

Applies to