D
Dan
When I execute the following with a purposely bogus URL, GetResponse throws
an error before I can retrieve the HttpStatusCode. Why is that?
try
{
HttpWebResponse response = (HttpWebResponse) m_request.GetResponse();
Console.WriteLine("Status Code = " + response.StatusCode);
}
catch(System.Net.WebException ex)
{
Console.WriteLine(ex.ToString()); // Returns "The remote server returned an
error: (404) Not Found"
}
an error before I can retrieve the HttpStatusCode. Why is that?
try
{
HttpWebResponse response = (HttpWebResponse) m_request.GetResponse();
Console.WriteLine("Status Code = " + response.StatusCode);
}
catch(System.Net.WebException ex)
{
Console.WriteLine(ex.ToString()); // Returns "The remote server returned an
error: (404) Not Found"
}