I'm doing an HTTPWebRequest to a client's web service, and always receive the following error.
System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Received an unexpected EOF or 0 bytes from the transport stream.
Here is the code
req = (HttpWebRequest)WebRequest.CreateDefault(uri);
req.ContentType = "text/xml; charset=utf-8";
req.Method = "POST";
stm = new StreamWriter(req.GetRequestStream(), Encoding.UTF8);
response = req.GetResponse();
responseStream = response.GetResponseStream();
But if I add the following
req.Proxy = new
and turn on Fiddler then all the requests succeed. Any ideas??? Fiddler or the use of the WebProxy object is doing something to make everything work. Thanks!
View Complete Post