ContentType的问题,HTTPHelper默认的是text/html,这里浏览器的默认的是application/json,
[C#] 纯文本查看 复制代码 private string GetHttp20200611165500()
{
SufeiUtil.HttpHelper http = new SufeiUtil.HttpHelper();
SufeiUtil.HttpItem item = new SufeiUtil.HttpItem()
{
URL = "https://translate.google.cn/translate_a/single?client=webapp&sl=auto&tl=en&hl=zh-CN&dt=at&dt=bd&dt=ex&dt=ld&dt=md&dt=qca&dt=rw&dt=rm&dt=sos&dt=ss&dt=t&dt=gt&otf=2&ssel=3&tsel=3&kc=1&tk=124033.512245&q=%e7%96%ab%e6%83%85%e4%b8%8e%e5%8a%a8%e4%b9%b1%e4%b9%8b%e4%b8%8b%ef%bc%8c%e7%be%8e%e8%82%a1%e4%b8%89%e5%a4%a7%e6%8c%87%e6%95%b0%e9%bd%90%e5%88%9b%e8%bf%91%e4%b8%89%e4%b8%aa%e6%9c%88%e6%96%b0%e9%ab%98%ef%bc%8c%e7%ba%b3%e6%96%af%e8%be%be%e5%85%8b%e6%8c%87%e6%95%b0%e8%b7%9d3%e6%9c%88%e7%9a%84%e5%ba%95%e9%83%a8%e5%b7%b2%e5%8f%8d%e5%bc%b9%e8%bf%9150%ef%bc%8c%e8%b7%9d%e7%a6%bb%e5%8e%86%e5%8f%b2%e6%9c%80%e9%ab%98%e7%82%b9%e4%bd%8d%e7%9a%84%e8%b7%9d%e7%a6%bb%e4%bb%85%e5%89%a91.58%e3%80%82%e7%be%8e%e5%9b%bd%e6%9a%82%e5%81%9c%e6%89%80%e6%9c%89%e4%b8%ad%e5%9b%bd%e5%ae%a2%e8%bf%90%e8%88%aa%e7%8f%ad",
Method = "GET",
ContentType = "application/json;charset=utf-8"
};
SufeiUtil.HttpResult result = http.GetHtml(item);
string html = result.Html;
return html;
} |