Question

I'm using idhttp to get content of a site. After get the content, the site will change URL from www to www8 or www9 or www10, for example: www.sample.com is before posting, after posting it will be www10.sample.com. How to get it? Thank you.

Was it helpful?

Solution

What you are encountering is likely an HTTP redirect. TIdHTTP handles redirects automatically if its HandleRedirects property is set to True. TIdHTTP has an OnRedirect event so you can get the new URL being redirected to, or you can look at the TIdHTTP.Response.Location property (which can also be filled in by some non-redirect responses as well, such as when uploading a file to Amazon S3 via TIdHTTP.Put()).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top