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.

有帮助吗?

解决方案

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()).

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top