Is it possible to somehow force System.Net.WebRequest.GetResponse to return me the message body even on failure?
The reason why I'm trying to achieve this is because when I get an error from a server (say, error 400 Bad Request), the GetResponse method fails and simply says that an error 400 Bad Request occurred. However, the server is sending additional information in the body that explain what exactly has failed and how to correct the request - though, I can never get to these data.
Trying to read the stream from GetResponse when an error occured doesn't work.
Any idea on how to get to these data?
Thanks