commonMain.io.ktor.client.plugins.DataConversion.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ktor-client-core-jvm Show documentation
Show all versions of ktor-client-core-jvm Show documentation
Ktor is a framework for quickly creating web applications in Kotlin with minimal effort.
/*
* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.client.plugins
import io.ktor.client.*
import io.ktor.util.*
import io.ktor.util.converters.DataConversion
/**
* Object for installing [io.ktor.util.converters.DataConversion] as plugin
*/
public object DataConversion : HttpClientPlugin {
override val key: AttributeKey = AttributeKey("DataConversion")
override fun prepare(block: DataConversion.Configuration.() -> Unit): DataConversion {
val configuration = DataConversion.Configuration().apply(block)
return DataConversion(configuration)
}
override fun install(plugin: DataConversion, scope: HttpClient) {
// no op
}
}