Use the "Accept Encoding" header to indicate that you can decode compressed content

By [)ia6l0 iii

Add the AcceptEncoding attribute to the header collection in the Request object.

e.g. request.Headers.Add(HttpRequestHeader.AcceptEncoding, ""gzip,deflate"");

Needless to say, you would need to decompress it.

Stream  myStream = response.GetResponseStream();
if (response.ContentEncoding.ToLower().Contains(""gzip""))
myStream = new GZipStream(strm, CompressionMode.Decompress);
else if (response.ContentEncoding.ToLower().Contains(""deflate""))
myStream = new DeflateStream(strm, CompressionMode.Decompress);

Use the "Accept Encoding" header to indicate that you can decode compressed content  (1060 Views)