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!

Have you tried using HttpWebResponse.ResponseUri?

Dim response As HttpWebResponse
Dim resUri As String

response = request.GetResponse
resUri = response.ResponseUri.AbsoluteUri
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.