I am trying to find out how many times my web request was redirected before I finally landed in the final content.
I create my web request as follows:
var httpRequest = (HttpWebRequest) WebRequest.Create("some arb path");
httpRequest.AllowAutoRedirect = followRedirects;
I looked at the following URL http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.maximumautomaticredirections.aspx
However, I do not want to impose a restriction. I really want him to keep track of all redirects (not wanting links to all URLs), but simply, for example, says "You have been redirected X times."
I hope there is a quick way to do this, as I currently assume that I will need to capture all 3xx codes and create a new request for each (hope not!).
source
share