954,510 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How To Get Redirected Url As String After Request

For example on any tinyurl/ajdeijad link (this one is fake), the link redirects to another url

I cant grab the whole response because it is 200 MB- what can I do to JUST GET THE URL

Here is my code:

Dim request1 As HttpWebRequest = DirectCast(HttpWebRequest.Create(urlvimeohd), HttpWebRequest)
            request1.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.112 Safari/535.1"
            request1.MaximumAutomaticRedirections = 1
            request1.AllowAutoRedirect = True

How do you retrieve the url of the response (it redirects!)

Thanks!

bob12321
Newbie Poster
4 posts since Aug 2011
Reputation Points: 10
Solved Threads: 0
 

Have you tried using HttpWebResponse.ResponseUri?

Dim response As HttpWebResponse
Dim resUri As String

response = request.GetResponse
resUri = response.ResponseUri.AbsoluteUri
Oxiegen
Master Poster
715 posts since Jun 2006
Reputation Points: 87
Solved Threads: 141
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: