Anonymous View

Ktor 3.5.0 Help

Redirect

By default, the Ktor client redirects to URLs provided in the Location header. If required, you can disable redirections.

Add dependencies

HttpRedirect only requires the ktor-client-core artifact and doesn't need any specific dependencies.

Disable redirects

To disable redirections, set the followRedirects property to false in a client configuration block:

val client = HttpClient(CIO) { followRedirects = false }
02 April 2024