title: Consume WebAPI with login credential
body: <p>I am trying to call a webapi from C#, the webapi is hosted in IIS and requires login when you access it.</p>
  
  <p>I don't know how to call the webapi with current login credential, and if I don't pass anything, the result will be the HTML for the login page.</p>
  
  <pre><code>using (var httpClient = new HttpClient())
  {
      var response = httpClient.GetAsync("url").Result;                    
      var result = response.Content.ReadAsStringAsync().Result;
  }
  </code></pre>
  
  <p>I remember there is a way to pass in the current login credential, but i can't seem to find it.</p>