title: HttpClient not sending basic authentication after redirect
body: <p>My code is making an HTTP GET to a web service URL that requires basic authentication.</p>
  
  <p>I've implemented this using an <code>HttpClient</code> with an <code>HttpClientHandler</code> that has the <code>Credentials</code> property defined.</p>
  
  <p>This all works perfectly.. Except for one of my use-cases where I'm making the authenticated GET to:
  <code>http://somedomain.com</code> which redirects to <code>http://www.somedomain.com</code>. </p>
  
  <p>It seems that the HttpClientHandler clears the authentication header during the redirect. How can I prevent this? I want the credentials to be sent regardless of redirects.</p>
  
  <p>This is my code:</p>
  
  <pre><code>// prepare the request
  var request = new HttpRequestMessage(method, url);
  using (var handler = new HttpClientHandler { Credentials = new NetworkCredential(username, password) , PreAuthenticate = true })
  using (var client = new HttpClient(handler))
  {
      // send the request
      var response = await client.SendAsync(request);
  </code></pre>
  
  <p>Note: this is a related question:
  <a href="https://stackoverflow.com/questions/14056766/keeping-http-basic-authentification-alive-while-being-redirected">Keeping HTTP Basic Authentification alive while being redirected</a>
  But since I'm using different classes for making the request, there might be a better, more specific solution</p>