public static HttpWebResponse GetErrorResponse(this string url)
{
try
{
var webReq = WebRequest.Create(url);
var webRes = webReq.GetResponse();
var strRes = webRes.ReadToEnd();
return null;
}
catch (WebException webEx)
{
return (HttpWebResponse)webEx.Response;
}
}