The underlying connection was closed: (HttpWebRequest) - C#
I am writing a code to authenticate the username and password through the POST request but I am getting an error which is saying that "The underlying connection was closed". I am trying to convert my old code with GET request to new code with POST request. My GET code which is working fine (Old Code): string url = "https://www.example.com/?username=" + username + "&password=" + password; XmlDocument xmldoc = new XmlDocument(); ServicePointManager.ServerCertificateValidationCallback += new RemoteCertificateValidationCallback(customXertificateValidation); ServicePointManager.SecurityProtocol =