Given a URL A which gets redirected to a 3rd party website B, in my application I need to to find out URL B for the given url A and insert it in DB , this can be a windows application or web or whichever way is faster and easier using C#!
Thanks !
P.S. I do not require the code to insert in DB.
WebRequest follows redirects without user intervention, so if the redirects are using 301/302 status codes then the following will work
If the redirects are created using javascript or HTTP-Equiv meta tags then you’re doing to have to parse the page and look for those. The HTML agility pack is probably the best way to do this.
To take this a little further the following is a class which will manually resolve the main HTTP redirect status codes, building up a history as it goes