Hi Team,
My api is working fine in Postman tool but in c# code it is throwing an error of bad request.
Please help me to convert below code into HttpWebrequest code.
var client = new RestClient("https://apiaddress/token");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddHeader("Cookie", "PF-AS=cc2RSXxt2s");
request.AddParameter("client_id", "d798b5e2c3337527bce6");
request.AddParameter("client_secret", "giyS5ZwFNa7j2QpROPYhAP");
request.AddParameter("grant_type", "client_credentials");
request.AddParameter("scope", "openid");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);