title: asp.net defaultCredentials issue
body: <p>I have an intranet site which calls a POST method from another server, also on the intranet.</p>
  
  <p>If I set the Authentication mode to Basic Authentication in IIS I can use the following:</p>
  
  <pre><code>HttpWebRequest oReq = (HttpWebRequest)WebRequest.Create(sURL);
   oReq.ContentType = "application/x-www-form-urlencoded";
   oReq.Method = "POST";
   oReq.Timeout = 60000;
  
   ...
  
   oReq.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;
  
   ...
  
  
  try
  {
     HttpWebResponse oResp = (HttpWebResponse)oReq.GetResponse();
     ...
  }
  </code></pre>
  
  <p>All of the above works as intended.</p>
  
  <p>However I need to change the security to Windows Authentication in IIS, and once I do I keep getting error 401 unauthorized on this line:</p>
  
  <pre><code>try
      {
         HttpWebResponse oResp = (HttpWebResponse)oReq.GetResponse();
         ...
      }
  </code></pre>
  
  <p>That can be fixed by changing the credentials like so:</p>
  
  <pre><code>NetworkCredential creds = new NetworkCredential("username","password","domain");
  oReq.Credentials = creds;
  </code></pre>
  
  <p>But that's not the right way anyway. How can I get the default credentials to work for Windows Authentication also?</p>