title: How to authenticate against a proxy when using the HttpClient class?
body: <p>I have a console app built on .NET 4 that uses the <code>HttpClient</code> library (obtained via NuGet) to retrieve data from a public API over the internet. The console app sits behind a proxy. The Windows machine it sits on has the correct proxy settings in Internet Explorer. When the console application attempts to access the outside world it is given a 407 status - "proxy authentication required". </p>
  
  <p>I've written no specific code to deal with a proxy yet. I'm assuming from the 407 error that the application is directing to the proxy no problem, but the proxy isn't authenticating the request. </p>
  
  <p>My question is, is it possible to set the HttpClient to use the credentials of the logged in user to authenticate the proxy? If so, how? </p>
  
  <pre class="lang-cs prettyprint-override"><code>var client = new HttpClient(webRequestHandler);
  client.PostAsync(RequestUri, MyContent);
  </code></pre>