By default, the Ktor client redirects to URLs provided in the Location
header. If required, you can disable redirections.
HttpRedirect
only requires the ktor-client-core artifact and doesn't need any specific dependencies.
To disable redirections, set the followRedirects
property to false
in a client configuration block:
val client = HttpClient(CIO) {
followRedirects = false
}