For the compression of response content, general Web servers (such as IIS) provide built-in support, just need to include Accept-Encoding: gzip, deflate in the request header, client browser and HttpClient provide built-in decompression support. Following are the code to enable this compression in HttpClient is as follows:
var httpClient = new HttpClient(new HttpClientHandler { AutomaticDecompression =
System.Net.DecompressionMethods.GZip | System.Net.DecompressionMethods.Deflate });
Posted On:
11-Nov-2021 09:12