Author: sergioalvares | Posted on: 8/19/2008 2:36:05 AM | Views : 497

Hi Guys
I am having a lot of trouble with setting up valid authentication on an HttpWebRequest. IIS is currently set to windows authentication, I am trying to scrape a page hosted under the same web application in IIS (therefore also requires windows auth). Problem is now when I create the new HttpWebRequest it doesn't carry the current Crentials over.
 Line 11 is where it falls over with "The remote server returned an error (401) Unautherized."1 // new request
2 HttpWebResquest request = (HttpWebResquest)WebRequest.Create(uri.AbsoluteUri);
3
4 // setup credentials for the new request
5 CredentialCache credCache = new CredentialCache();
6 credCache.Add(new Uri("http://localhost"), "Negotiate&q ...

Go to the complete details ...