Get redirected url from code

Posted by Skoder on Stack Overflow See other posts from Stack Overflow or by Skoder
Published on 2010-04-24T14:07:07Z Indexed on 2010/04/24 14:13 UTC
Read the original article Hit count: 248

Filed under:
|
|
|
|

Hey,

I'm using an API which, given a url, redirects to a file on the server. The file names have "_s,_m and _l" appended to the end (small, medium, large). However, since the url's querystring is parsed dynamically, I don't retrieve the actual file name. The image displays correctly, but is it possible to retrieve the filename of the image file from the code? (i.e. where the url has redirected to)?

e.g. http://api.somesite.com/getimage?small (this is what I enter)
"http://somesite.com/images/userimage_s" (this is where it redirects to. I would like to get this address from code)

Thanks for any advice

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET