a webclient that automatically decompress gzip to html

Here is the class that will do this:

class MyWebClient : WebClient
    protected override WebRequest GetWebRequest(Uri address)
        HttpWebRequest request = base.GetWebRequest(address) as HttpWebRequest;
        request.AutomaticDecompression = DecompressionMethods.Deflate | DecompressionMethods.GZip;
        return request;


var client = new MyWebClient();
downloadString = client.DownloadString(RequestURL);

What's your thoughts on this?


Protected by WP Anti Spam