installOrReplace
fun <TBuilder : Any, TPlugin : Any> installOrReplace(plugin: HttpClientPlugin<TBuilder, TPlugin>, configure: TBuilder.() -> Unit = {})(source)
Installs the specified plugin and optionally configures it using the configure block. If the plugin is already installed, the configuration block will replace the existing configuration class.
val client = HttpClient {
installOrReplace(ContentNegotiation) {
// configuration block
json()
}
}Content copied to clipboard
Learn more from Plugins.