W
Wilfried Mestdagh [MapPoint MVP]
Hello,
I connect to a server like this:
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(Url);
req.Method = "POST";
StreamWriter stOut = new StreamWriter(req.GetRequestStream(),
System.Text.Encoding.ASCII);
stOut.Write(xml);
stOut.Close();
HttpWebResponse webResponse = (HttpWebResponse)req.GetResponse();
When the server answers with a 502 then I have an exception in the last
line. the message is: The remote server returned an error: (502) Bad Gateway.
But where can I find the 502 itself? It should be stored in some property
but I cannot find it. I need to know the return value from the server and
react in my code depending on particular return values.
I connect to a server like this:
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(Url);
req.Method = "POST";
StreamWriter stOut = new StreamWriter(req.GetRequestStream(),
System.Text.Encoding.ASCII);
stOut.Write(xml);
stOut.Close();
HttpWebResponse webResponse = (HttpWebResponse)req.GetResponse();
When the server answers with a 502 then I have an exception in the last
line. the message is: The remote server returned an error: (502) Bad Gateway.
But where can I find the 502 itself? It should be stored in some property
but I cannot find it. I need to know the return value from the server and
react in my code depending on particular return values.