Getting Http Status code number (200, 301, 404, etc.) from HttpWebRequest and HttpWebResponse
- by James Lawruk
I am trying to get the HTTP status code number from the HttpWebResponse object returned from a HttpWebRequest. I was hoping to get the actual numbers (200, 301,302, 404, etc.) rather than the text description. ("Ok", "MovedPermanently", etc.) Is the number buried in a property somewhere in the response object? Any ideas other than creating a…