http
It is implemented in the library, http
and contains functions related to the HTTP request-response exchange.
get a final URL after following all redirected HTTP requests or the original URL if there is no such redirection |
getRedirectUrl
Get a final URL after following all redirected HTTP requests or the original URL if there is no such redirection.
getRedirectUrl(URL)
Where:
-
URL
is the URL of the source to be checked for redirections.
Example
@library("http:", "http").
input("https://initialurl.com").
result(X) :- input(Y), X = http:getRedirectUrl(Y).
@output("result").
Expected results
result("http://finalurl.com")