What is the equivalent Authentication for a NetworkCredential (C#) in Postman?
The code below works, I was just trying to replicate this C# code in Postman in calling the API, I’ve tried using Basic Auth and NTLM Auth, but didn’t work:
private async Task<HttpResponseMessage> PostAsync(string uri)
{
//just sample dummy credential
var user ="userA";
var password ="123456";
var domain = "DIR";
string body = "[1]"; //some type needed for the api call
var credentials = new NetworkCredential(user, password, domain);
var handler = new HttpClientHandler { Credentials = credentials };
using (var content = new StringContent(body, Encoding.UTF8, "application/json"))
using (var client = new HttpClient(handler))
{
return await client.PostAsync(uri, content);
}
}
Sorry, just wanted to ask help here.