Httpwebrequest / Httpwebresponse - Redirect Count -


How often did I find my web request before reaching the end of the content.

I am creating my web request as follows:

  var httpRequest = (HttpWebRequest) WebRequest.Create ("some arc path"); HttpRequest.AllowAutoRedirect = Follow Followed;  

I have seen the following URL

However, I do not want to apply the limit. I really want to follow all the redirects (not really in the context of all the URLs), but just for example "You have been redirected X times".

I hope there is a quick way to do this: Currently, I'm assuming that I have to capture all the 3xx codes and make a new request for everyone (hopefully not!).

There is no way you can achieve what you want. You must capture every 3xx request and there will be a new issue with the redirection's location header.

However, if you want to use the original C / C ++ code and directly use WININET (which is the library used by IE) it will redirect you to each redirect (via the callback mechanism ) Will provide notification.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -