I wish to automatically uncompress GZiped response.
I am using the following snippet:
mywebclient.Headers[HttpRequestHeader.AcceptEncoding] = "gzip";
mywebclient.Encoding = Encoding.UTF8;
try
{
var resp = mywebclient.DownloadData(someUrl);
}
I have checked HttpRequestHeader enum
, and there is no option to do this via the Headers
How can I automatically decompress the resp? or Is there another function I should use instead of mywebclient.DownloadData
?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…