I'm grabbing web page using WebClient, and I would like to know if that page
has a redirection...
how could I know that?
is there any dinamyc property in WebClient?

Re: System.Net.WebClient and redirection by Vadym

Vadym
Thu Jan 17 16:38:22 CST 2008

Hello, buu!

WebClient class instance has AllowAutoRedirect set true. So it has to
automatically follow redirection responses.

--
With best regards, Vadym Stetsiak.
Blog: http://vadmyst.blogspot.com

You wrote on Thu, 17 Jan 2008 23:19:36 +0100:

b> I'm grabbing web page using WebClient, and I would like to know if
b> that page has a redirection...
b> how could I know that?
b> is there any dinamyc property in WebClient?





Re: System.Net.WebClient and redirection by buu

buu
Fri Jan 18 16:38:54 CST 2008

Is it better to use WebRequest?
is it is... why? or why not?


"Vadym Stetsiak" <vadmyst@gmail.com> wrote in message
news:OCk3smVWIHA.4696@TK2MSFTNGP05.phx.gbl...
> Hello, buu!
>
> WebClient class instance has AllowAutoRedirect set true. So it has to
> automatically follow redirection responses.
>
> --
> With best regards, Vadym Stetsiak.
> Blog: http://vadmyst.blogspot.com
>
> You wrote on Thu, 17 Jan 2008 23:19:36 +0100:
>
> b> I'm grabbing web page using WebClient, and I would like to know if
> b> that page has a redirection...
> b> how could I know that?
> b> is there any dinamyc property in WebClient?
>
>
>
>



Re: System.Net.WebClient and redirection by buu

buu
Sat Jan 19 06:48:04 CST 2008

but, how could I know if I got redirected page?
how could I detect it?


"Vadym Stetsiak" <vadmyst@gmail.com> wrote in message
news:OCk3smVWIHA.4696@TK2MSFTNGP05.phx.gbl...
> Hello, buu!
>
> WebClient class instance has AllowAutoRedirect set true. So it has to
> automatically follow redirection responses.
>
> --
> With best regards, Vadym Stetsiak.
> Blog: http://vadmyst.blogspot.com
>
> You wrote on Thu, 17 Jan 2008 23:19:36 +0100:
>
> b> I'm grabbing web page using WebClient, and I would like to know if
> b> that page has a redirection...
> b> how could I know that?
> b> is there any dinamyc property in WebClient?
>
>
>
>



Re: System.Net.WebClient and redirection by Vadym

Vadym
Sat Jan 19 07:57:40 CST 2008

Hello, buu!

When using HttpWebRequest it automatically handles redirects, unless you
disable it with the AllowAutoRedirect=false

When disabled you'll get the page with redirect information and will have to
make redirection manually.
In this case HTTP status code returned will be 301.

New location of a resource will be specified under header "Location"
--
With best regards, Vadym Stetsiak.
Blog: http://vadmyst.blogspot.com

You wrote on Fri, 18 Jan 2008 23:38:54 +0100:

b> Is it better to use WebRequest?
b> is it is... why? or why not?