When using the HttpClient in .net 4.5 to do basic authentication I'm finding that it's issuing 2 requests.
The first fails with a HTTP/1.1 401 Unauthorized and then it resends the request to which we get a HTTP/1.1 200 OK.
Any ideas on how to stop it from doing this?
var credential = new NetworkCredential
{
UserName = username,
Password = password
}
var httpClientHandler = new System.Net.Http.HttpClientHandler
{
Credentials = credential
};
httpClient = new HttpClient(httpClientHandler, true)
{
BaseAddress = address
};