private static string GetErrorStringFromException(WebException webException, HttpWebResponse response) { var s = webException.Data["original-value"] as string; if (s != null) return s; using (var streamReader = new StreamReader(response.GetResponseStreamWithHttpDecompression())) { return streamReader.ReadToEnd(); } }
private static void GetValue(HttpWebResponse response) { using (var streamReader = new StreamReader(response.GetResponseStreamWithHttpDecompression())) { var error = streamReader.ReadToEnd(); } }