-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Closed
Labels
area-System.Net.Httptenet-compatibilityIncompatibility with previous versions or .NET FrameworkIncompatibility with previous versions or .NET Framework
Milestone
Description
I'm trying to use HttpClient to call rest api that requires NTLM authentication.
Below code works fine in .net core 2.2 but keep getting 401 with .net core 3.1
static void Main(string[] args)
{
var client = Create("base-url");
var response = client.GetAsync("api/v1.0/token").Result;
HttpClient Create(string urlRoot)
{
var uri = new Uri(urlRoot);
var handler = new HttpClientHandler() { PreAuthenticate = true, UseDefaultCredentials = true};
var httpClient = new HttpClient(handler) { BaseAddress = uri };
httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
return httpClient;
}
}This is running in windows 10.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-System.Net.Httptenet-compatibilityIncompatibility with previous versions or .NET FrameworkIncompatibility with previous versions or .NET Framework