connectionexception

httpWebRequest (The underlying connection was closed: The connection was closed unexpectedly.)

亡梦爱人 提交于 2020-01-22 09:08:29
问题 I am developing an C# application which logs data from a webserver. It sends the following post request to the webserver and awaits for the response. /// <summary> /// Function for obtaining testCgi data /// </summary> /// <param name="Parameters"></param> /// <returns></returns> private string HttpmyPost(string Parameters) { string str = "No response"; HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uriTestCGI); request.Method = "POST"; byte[] bytes = Encoding.UTF8.GetBytes

httpWebRequest (The underlying connection was closed: The connection was closed unexpectedly.)

只谈情不闲聊 提交于 2019-12-03 02:20:55
I am developing an C# application which logs data from a webserver. It sends the following post request to the webserver and awaits for the response. /// <summary> /// Function for obtaining testCgi data /// </summary> /// <param name="Parameters"></param> /// <returns></returns> private string HttpmyPost(string Parameters) { string str = "No response"; HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uriTestCGI); request.Method = "POST"; byte[] bytes = Encoding.UTF8.GetBytes(Parameters); request.ContentLength = bytes.Length; Stream requestStream = request.GetRequestStream();