I am trying to connect to the deployment server using C# and REST. I can connect to the search Head over HTTPS but I get error:
"The underlying connection was closed:
when trying to connect to this URI: http://depl_server:8089/service/auth/login
Is this not possible?
VS2015:
code:
if (!string.IsNullOrEmpty(sessionKey))
req.Headers.Add("Authorization", "Splunk " + sessionKey);
if (httpMethod == "POST")
{
if (!string.IsNullOrEmpty(args)) req.ContentLength = args.Length;
req.ContentType = "application/x-www-form-urlencoded";
Stream reqStream = req.GetRequestStream();
StreamWriter sw = new StreamWriter(reqStream);
sw.Write(args);
sw.Close();
}
↧