[REBOL] Re: How to get a redirected url?
From: brett::codeconscious::com at: 23-Nov-2001 11:18
Hi Mat,
> If you have a URL that redirects somewhere, how can you tell where it
> is redirecting? IE obtain the URL where you are being redirected.
Quoting Sterling:
port: open http://www.abc.com/
probe port/locals/list
probe port/url
close port
This is the list of redirected url's. There may be more than one.
The list is empty if there were no redirects. The list contains al
lredirected url's if there were any. The last URL read is not in the
list and, as you know, can be found in port/url.
So the better one-liner to see if you got redirected after an open is:
empty? port/locals/list
Brett.