M
Mr Flibble
Hey!
I get a 404 from a website (this is "correct behaviour") and I'm
interested in the value in the cookie "SMSESSION".
The question is the following code generates an exception due to the
404. How am I still able to read the cookies even though I get an
exception?
Here's the code:
HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse();
if (webResponse.Cookies != null && webResponse.Cookies.Count != 0)
{
foreach (Cookie c in webResponse.Cookies)
{
Console.WriteLine("\t" + c.ToString());
}
}
I get a 404 from a website (this is "correct behaviour") and I'm
interested in the value in the cookie "SMSESSION".
The question is the following code generates an exception due to the
404. How am I still able to read the cookies even though I get an
exception?
Here's the code:
HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse();
if (webResponse.Cookies != null && webResponse.Cookies.Count != 0)
{
foreach (Cookie c in webResponse.Cookies)
{
Console.WriteLine("\t" + c.ToString());
}
}