title: HttpClient and using proxy - constantly getting 407
body: <p>Here is the code:</p>
  
  <pre><code> HttpClient client = null;
   HttpClientHandler httpClientHandler = new HttpClientHandler()
   {
      Proxy = new WebProxy(string.Format("{0}:{1}", proxyServerSettings.Address, 
      proxyServerSettings.Port),false),
      PreAuthenticate = true,
      UseDefaultCredentials = false,
   };
  
  
   this.httpClientHandler.Credentials = new NetworkCredential(proxyServerSettings.UserName, 
                          proxyServerSettings.Password);
  
  
   this.client = new HttpClient(this.httpClientHandler);
  </code></pre>
  
  <p>And when I finally do this:</p>
  
  <pre><code>HttpResponseMessage httpResponseMessage = this.client.PostAsync(urlToPost, new StringContent(data, Encoding.UTF8, this.mediaType)).Result;
  </code></pre>
  
  <p>It always throws the </p>
  
  <blockquote>
    <p>The remote server returned an error: (407) Proxy Authentication
    Required.</p>
  </blockquote>
  
  <p>Which I do not understand for the world of me.</p>
  
  <p>The same proxy set up works just fine when is configured in IE10 or if I use the <code>HttpWebRequest</code> class instead</p>