代码改变世界

HttpClient + IIS压缩动态内容

2020-08-11 21:33  山不转水转...  阅读(173)  评论(0编辑  收藏  举报

IIS 设置

 

 

HttpClient设置

 var handler = new HttpClientHandler
            {
                UseProxy = useProxy
            };

            if (handler.SupportsAutomaticDecompression)
            {
                handler.AutomaticDecompression = DecompressionMethods.GZip |
                                                 DecompressionMethods.Deflate;
            }

            _client = new HttpClient(handler);