Skip to content

Commit a4d95ef

Browse files
ManickaPliveans
andauthored
Details about AutomaticDecompression (#8472)
* Details about AutomaticDecompression * Update xml/System.Net.Http/HttpClientHandler.xml Co-authored-by: Ahmet İbrahim AKSOY <aaksoy@microsoft.com> * Update xml/System.Net.Http/SocketsHttpHandler.xml Co-authored-by: Ahmet İbrahim AKSOY <aaksoy@microsoft.com> Co-authored-by: Ahmet İbrahim AKSOY <aaksoy@microsoft.com>
1 parent a48dd56 commit a4d95ef

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

xml/System.Net.Http/HttpClientHandler.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,12 @@ These configuration options are not available starting with .NET 5.
207207
<format type="text/markdown"><![CDATA[
208208
209209
## Remarks
210+
Automatic decompression works only on the top most compression. So if the content is compressed multiple times, only the last compression will be decompressed.
211+
For example, for a reponse with `Content-Encoding: gzip, br` header, the content will only be decompressed using Brotli, leaving the still gzipped content in the <xref:System.Net.Http.HttpResponseMessage.Content>.
212+
213+
Setting automatic decompression to anything else than <xref:System.Net.DecompressionMethods.None> will cause adding `Accept-Encoding` header with the set values into every outgoing <xref:System.Net.Http.HttpRequestMessage>.
214+
215+
210216
For the .NET Framework 4.x `System.Net.Http` binary in the Global Assembly Cache (GAC), the default value is <xref:System.Net.DecompressionMethods.None>.
211217
212218
When the [`System.Net.Http` NuGet package](https://www.nuget.org/packages/System.Net.Http/) v4.1.0 to v4.3.2 is used, the default is <xref:System.Net.DecompressionMethods.GZip> and <xref:System.Net.DecompressionMethods.Deflate>.

xml/System.Net.Http/SocketsHttpHandler.xml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,17 @@ These configuration options are not available starting with .NET 5.
180180
<Docs>
181181
<summary>Gets or sets the type of decompression method used by the handler for automatic decompression of the HTTP content response.</summary>
182182
<value>The type of decompression method used by the handler for automatic decompression of the HTTP content response.</value>
183-
<remarks>To be added.</remarks>
183+
<remarks>
184+
<format type="text/markdown"><![CDATA[
185+
186+
## Remarks
187+
Automatic decompression works only on the top most compression. So if the content is compressed multiple times, only the last compression will be decompressed.
188+
For example, for a reponse with `Content-Encoding: gzip, br` header, the content will only be decompressed using Brotli, leaving the still gzipped content in the <xref:System.Net.Http.HttpResponseMessage.Content>.
189+
190+
Setting automatic decompression to anything else than <xref:System.Net.DecompressionMethods.None> will cause adding `Accept-Encoding` header with the set values into every outgoing <xref:System.Net.Http.HttpRequestMessage>.
191+
192+
]]></format>
193+
</remarks>
184194
</Docs>
185195
</Member>
186196
<Member MemberName="ConnectCallback">

0 commit comments

Comments
 (0)