G
Georg
Hello,
I am trying to load a web page over a HTTP proxy with the POST method
and I am using the following code:
// open request (string url)
HttpWebRequest httpWebRequest =
(HttpWebRequest)WebRequest.Create(url);
// set proxy
WebProxy proxy = new WebProxy("http://....(my...Proxy)....:81");
httpWebRequest.Proxy = proxy;
// send POST data ( byte[] postDataAscii)
httpWebRequest.Method = "POST";
httpWebRequest.ContentType = "application/x-www-form-urlencoded";
httpWebRequest.ContentLength = postDataAscii.Length;
Stream outStream = httpWebRequest.GetRequestStream();
outStream.Write(postDataAscii, 0, postDataAscii.Length);
outStream.Close();
// get the response
HttpWebResponse httpWebResponse =
(HttpWebResponse)httpWebRequest.GetResponse();
.....
My problem is, that at the line
httpWebRequest.GetResponse();
an System.Net.WebException is thrown:
"Die zugrunde liegende Verbindung wurde geschlossen: Die Verbindung
wurde
unerwartet getrennt.." - in english: "... the connection has been
closed unexpectedly"
What can I do?
Georg Gerber
I am trying to load a web page over a HTTP proxy with the POST method
and I am using the following code:
// open request (string url)
HttpWebRequest httpWebRequest =
(HttpWebRequest)WebRequest.Create(url);
// set proxy
WebProxy proxy = new WebProxy("http://....(my...Proxy)....:81");
httpWebRequest.Proxy = proxy;
// send POST data ( byte[] postDataAscii)
httpWebRequest.Method = "POST";
httpWebRequest.ContentType = "application/x-www-form-urlencoded";
httpWebRequest.ContentLength = postDataAscii.Length;
Stream outStream = httpWebRequest.GetRequestStream();
outStream.Write(postDataAscii, 0, postDataAscii.Length);
outStream.Close();
// get the response
HttpWebResponse httpWebResponse =
(HttpWebResponse)httpWebRequest.GetResponse();
.....
My problem is, that at the line
httpWebRequest.GetResponse();
an System.Net.WebException is thrown:
"Die zugrunde liegende Verbindung wurde geschlossen: Die Verbindung
wurde
unerwartet getrennt.." - in english: "... the connection has been
closed unexpectedly"
What can I do?
Georg Gerber