title: HTTP CONNECTION ERROR
body: <p>Am getting this error The underlying connection was closed: An unexpected error occurred on a send.</p>
  
  <p>Below is part the c# code</p>
  
  <pre><code>        StringBuilder postData = new StringBuilder();
          postData.Append("cmpi_msg=" + 
          HttpUtility.UrlEncode(elem.ToString()));
  
          ASCIIEncoding encoding = new ASCIIEncoding();
          byte[] data = encoding.GetBytes(postData.ToString());
         // ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;
          HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
          request.Method = "POST";
          request.Timeout = 30 * 1000;
          request.ContentType = "application/x-www-form-urlencoded";
          request.ContentLength = data.Length;
          Stream newStream = request.GetRequestStream();
          newStream.Write(data, 0, data.Length);
          //newStream.Flush();
          //newStream.Close();
          //request.KeepAlive = false;
  
          string resText = "";
          //ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;
  
          using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
          {
              Encoding enc = System.Text.Encoding.GetEncoding(1252);
              using (StreamReader rs = new StreamReader(response.GetResponseStream(), enc))
              {
                  resText = rs.ReadToEnd();
                  //Console.WriteLine("RES:" + resText);
              }
          }
  </code></pre>