我在尝试从CloudFlare托管的网站下载网页数据。它在进入页面之前使用HTTPS并获取连接的ID。Httpresponse错误503
我试图获得的WebRequest和WebResponse的ID,但我发现了以下错误:
An unhandled exception of type 'System.Net.WebException' occurred in System.dll Additional information: The remote server returned an error: (503) Server Unavailable.
我试图让从提琴手的请求,这里是回应:
HTTP/1.1 503 Service Temporarily Unavailable
Date: Tue, 12 May 2015 13:38:17 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: __cfduid=d57a7d982035dad7ebafe63444d125e451431437897; expires=Wed, 11-May-16 13:38:17 GMT; path=/; domain=.hornystress.me; HttpOnly
X-Frame-Options: SAMEORIGIN
Refresh: 8;URL=/cdn-cgi/l/chk_jschl?pass=1431437901.815-Ym1g5qTodK
Cache-Control: no-cache
Server: cloudflare-nginx
CF-RAY: 1e5685ed559606ee-LHR
这里是我的代码:
public static string GetCookie(string link)
{
WebRequest request = WebRequest.Create("https://hornystress.me");
request.Proxy = WebProxy.GetDefaultProxy();
request.Timeout *= 100;
WebResponse response = request.GetResponse();
return response.Headers.Get("Set-Cookie");
}
我编辑了自己的冠军。请参阅:“[应该在其标题中包含”标签“](http://meta.stackexchange.com/questions/19190/)”,其中的共识是“不,他们不应该”。 –
任何一个?请重要 –