简体   繁体   English

WebClient请求超时

[英]WebClient request timeout

I'm trying to return some html from a url via the WebClient class: 我试图通过WebClient类从URL返回一些html:

Response.Write(new System.Net.WebClient().DownloadString("http://www.partnersite.com/html/"));

Whenever this code runs I get a timeout. 每当此代码运行时,我都会超时。

The request was aborted: The operation has timed out. 该请求已中止:操作已超时。

If I browse directly to "http://www.partnersite.com/html/" I get an immediate response. 如果直接浏览到“ http://www.partnersite.com/html/”,我会立即得到答复。

The timeout only seems to happen with this particular website, if I make a request to another site eg. 如果我向另一个网站发出请求,则似乎仅在该特定网站上发生超时。

    WebClient().DownloadString("http://www.google.com"));

I'm instantly returned the html. 我立即返回了html。

Is this simply a case of something going on at the partner site which means it's not responding? 这仅仅是合作伙伴站点上发生某事的情况,这意味着它没有响应吗? Or is there something else I can try before making that call? 还是在拨打电话之前可以尝试其他方法?

Thanks. 谢谢。

Is the site accessible from Internet Explorer? 可以从Internet Explorer访问该网站吗?

If not and if the site is in the same network, check whether you have bypassed the proxy for the site from the Internet Explorer options. 如果不是,并且该站点位于同一网络中,请检查是否已从Internet Explorer选项中绕过该站点的代理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM