ktor-client-core / io.ktor.client.features / HttpRedirect

HttpRedirect

class HttpRedirect

HttpClient feature that handles http redirect

Types

Feature

companion object Feature : HttpClientFeature<HttpRedirect, HttpRedirect>

Constructors

<init>

HttpRedirect()

HttpClient feature that handles http redirect

Properties

allowHttpsDowngrade

var allowHttpsDowngrade: Boolean

true value allows client redirect with downgrade from https to plain http.

checkHttpMethod

var checkHttpMethod: Boolean

Check if the HTTP method is allowed for redirect. Only HttpMethod.Get and HttpMethod.Head is allowed for implicit redirect.

Companion Object Properties

key

val key: AttributeKey<HttpRedirect>

The AttributeKey for this feature.

Companion Object Functions

install

fun install(feature: HttpRedirect, scope: HttpClient): Unit

Installs the feature class for a HttpClient defined at scope.

prepare

fun prepare(block: HttpRedirect.() -> Unit): HttpRedirect

Builds a TFeature by calling the block with a TConfig config instance as receiver.