protected string GetResponse(WebRequest request) { var responseString = new StringBuilder(); var response = (HttpWebResponse) request.GetResponse(); responseString.AppendLine(string.Format("[Status Code : {0}]", response.StatusCode)); responseString.AppendLine(string.Format("[Status Desc : {0}]", response.StatusDescription)); responseString.AppendLine(string.Format("[Server : {0}]", (response.Server))); responseString.AppendHorizontalRule("Body Start"); Stream responseStream = response.GetResponseStream(); var responseReader = new StreamReader(responseStream); responseString.AppendLine(responseReader.ReadToEnd()); responseString.AppendHorizontalRule("Body End"); return responseString.ToString(); }