visual studio - How to get page redirecting URL in vb.net -
so need url of page in vb.net way said page redirect.
like this: http://example.com/users/usertypeimg.php?id=1
redirects to: http://example.com/img/usertypemega.png
how tell endpoint of redirect (and url)
the httpclient class automatically redirect you, should need send get message original url, , read actual redirected url response:
public async function getredirectedurl(originalurl string) threading.tasks.task(of string) dim client new httpclient() dim response httpresponsemessage = await client.getasync("http://example.com/users/usertypeimg.php?id=1") return response.headers.location.tostring() end function
Comments
Post a Comment