Whenever I type some url like
http://youtube.com/watch/v/54GRe3ox_xI
in firefox browser when the address is immediately redirected to
http://youtube.com/swf/l.swf?video_id=54GRe3ox_xI&rel=1&eurl=&iurl=http%3A//i.yt
img.com/vi/54GRe3ox_xI/default.jpg&t=OEgsToPDskJ98NGh0lWiWIogmOD9369L
Is there a way in C# to get the above url
I tried implementing Using The HttpWebRequest And HttpWebResponse Class but
no use
Please Help Me
Regards
Rajkiran
Jon Skeet [C# MVP] - 22 Feb 2008 12:45 GMT
> Whenever I type some url like
>
[quoted text clipped - 9 lines]
> I tried implementing Using The HttpWebRequest And HttpWebResponse Class but
> no use
It should be fine with HttpWebRequest. You should get a 302 back.
Could you post a short but complete program which demonstrates the
problem?
See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.

Signature
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk
Nicholas Paldino [.NET/C# MVP] - 22 Feb 2008 13:08 GMT
Rajkiran,
You have to set the AllowAutoRedirect property on the HttpWebRequest
instance to false (the default is true). When this property is true, it
will automatically redirect the request on a 302 response to the URL
indicated in the 302 response. This will prevent that from happening and
return the 302 response to you, along with the redirect information.

Signature
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com
> Whenever I type some url like
>
[quoted text clipped - 13 lines]
> Regards
> Rajkiran