告诉我,任何人都可以通过 HttpClient 地址下载 http://www.wordreference.com/definition/like作为回应我明白了
是加密的内容,然后通过脚本打开浏览器吗?或者是别的什么?为了以防万一,我解释说:我在其他站点上尝试了我的代码,那里一切正常,我怀疑编码是问题所在。
应该用PS解压HttpClientHandler
private static async Task<string> GetAnswerAsync(string request)
{
string result = String.Empty;
HttpClientHandler handler = new HttpClientHandler()
{
AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate
};
using (HttpClient client = new HttpClient(handler))
using (var response = await client.GetAsync(request))
{
response.EnsureSuccessStatusCode();
result = await response.Content.ReadAsStringAsync();
}
return result;
}

内容可能已使用 gzip 或其他算法压缩。试试看: