Whenever I am adding an HTTP body into my Http Request I am getting a 401 response code. The same request is working postman perfectly fine.
var client = new RestClient("http://10.10.2.10:9000/haproxy_stats");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Basic QURNSU46UGFzc3dvcmQtMTIzNA==");
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("s", "server2");
request.AddParameter("action", "ready");
request.AddParameter("b", "#2");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);