Skip to content

Instantly share code, notes, and snippets.

@anujb
Created October 19, 2015 20:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anujb/52c9bb9f09725a30f8c7 to your computer and use it in GitHub Desktop.
Save anujb/52c9bb9f09725a30f8c7 to your computer and use it in GitHub Desktop.
public class GzipWebClient : WebClient
{
protected override WebRequest GetWebRequest(Uri address)
{
var request = base.GetWebRequest(address);
if(request is HttpWebRequest)
{
((HttpWebRequest)request).AutomaticDecompression = DecompressionMethods.Deflate | DecompressionMethods.GZip;
}
return request;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment