https://kotlinlang.org logo
#ktor
Title
# ktor
y

yschimke

08/05/2019, 1:12 PM
For the ktor http client, if it follows redirects. Is there a way to know the final URL?
e.g. if the redirect is from /about to /about/ the base href changes.
e

e5l

08/06/2019, 8:00 AM
Hi @yschimke, you could know the final url from a
request.url
in a response call.
y

yschimke

08/06/2019, 8:06 AM
Yep, that works. Thanks.
Copy code
this.get<HttpResponse>(url.toString()).use {
    println("$url ${it.call.request.url}")
👍 1
2 Views