问题
we are reading response from HttpWebResponse and the response itself is quite normal, we think. But when we try to read the string representation of that, we only receive strange characters instead of json formatted normal chars. Can anyone please tell us what is wrong here? Any question or help is welcomed, if more informations are needed, please comment. Thanks
回答1:
The response content encoding header is gzip indicating the content has been compressed by the server.
Set request.AutomaticDecompression
to tell the HttpWebResponse
you want it to decompress the data automatically.
来源:https://stackoverflow.com/questions/33080674/read-httpwebreponse-using-getresponsestream-readtoend-return-strange-characters