Reputation: 3791
In usual .NET environment we have a property AutomaticDecompression in class HttpWebRequest.
httpRequest.AutomaticDecompression =
(DecompressionMethods.GZip | DecompressionMethods.Deflate);
Problem is that i am on WinRT, and here is no such property in HttpWebRequest class. And what i have? I have GZip-compressed response stream...
Upvotes: 0
Views: 678
Reputation: 38077
Use the HttpClientHandler, as it supports the AutomaticDecompression:
System.Net.Http.HttpClientHandler hc = new System.Net.Http.HttpClientHandler();
hc.AutomaticDecompression = System.Net.DecompressionMethods.GZip;
System.Net.Http.HttpClient client = new System.Net.Http.HttpClient(hc);
var result = await client.GetAsync(uri)
Upvotes: 1