please see my latest code where i am using application/x-www-form-urlencoded but still getting same 401 status code. looking for next guidance.
I'm a little confused by your response as it does not follow the coding pattern in the link. I created a application/x-www-form-urlencoded test with HttpClient and it works as expected.
static async Task ExecuteFormPost()
{
string url = "https://localhost:44367/servicecall/tempsession";
var postParamters = new Dictionary<string, string>();
postParamters.Add("username", "username");
postParamters.Add("password", "password");
postParamters.Add("accesskey", "accesskey");
HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, url) { Content = new FormUrlEncodedContent(postParamters) };
HttpResponseMessage response = await client.SendAsync(request);
string text = await response.Content.ReadAsStringAsync();
Console.WriteLine(text);
}
I can't test the actual service as I do not have an account.