I\'m trying to implement a limited web crawler in C# (for a few hundred sites only) using HttpWebResponse.GetResponse() and Streamreader.ReadToEnd() , also tried using Strea
I had the same problem, but when I sat the HttpWebRequest's Proxy parameter to null, it solved the problem.
UriBuilder ub = new UriBuilder(url);
HttpWebRequest request = (HttpWebRequest)WebRequest.Create( ub.Uri );
request.Proxy = null;
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
I had problem the same problem but worst. response = (HttpWebResponse)webRequest.GetResponse(); in my code delayed about 10 seconds before running more code and after this the download saturated my connection.
kurt's answer defaultProxy enabled="false"
solved the problem. now the response is almost instantly and i can download any http file at my connections maximum speed :) sorry for bad english
Try to add cookie(AspxAutoDetectCookieSupport=1
) to your request like this
request.CookieContainer = new CookieContainer();
request.CookieContainer.Add(new Cookie("AspxAutoDetectCookieSupport", "1") { Domain = target.Host });