Recently, some of our users reported that they had an internal C # web request 500 server error.
Here’s my code:
HttpWebRequest req = WebRequest.Create (url) as HttpWebRequest;WebResponse wr = req.GetResponse ();
If the server returns 500 Internal Server Error, an exception is thrown in req.GetResponse ().I want GetResponse () to accept this response code. The URL passed in triggers this response code – that’s ok. I want to parse the HTML despite an internal server error with a 500 response code. Can you tell GetResponse () not to validate the response code?