示例#1
0
 private static void GetValue(HttpWebResponse response)
 {
     using (var streamReader = new StreamReader(response.GetResponseStreamWithHttpDecompression()))
     {
         var error = streamReader.ReadToEnd();
     }
 }
        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());
            }
        }