Bellow is my code calling a microsoft reporting service. In the production environment some times it logs this exception "Too many automatic redirections were attempted." in my log file. Can anyone explain me about possible reasons to throw this exception??
byte[] buff = new byte[1024];
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
using (HttpWebResponse r = (HttpWebResponse)request.GetResponse())
{
using (Stream reader = r.GetResponseStream())
{
int bytes = 0;
while ((bytes = reader.Read(buff, 0, buff.Length)) > 0)
{
_response.OutputStream.Write(buff, 0, bytes);
}
}
}
}
catch (Exception ex)
{
...
Go to the complete details ...