install
fun <TBuilder : Any, TPlugin : Any> install(plugin: HttpClientPlugin<TBuilder, TPlugin>, configure: TBuilder.() -> Unit = {})
Installs the specified plugin and optionally configures it using the configure block.
val client = HttpClient {
install(ContentNegotiation) {
// configuration block
json()
}
}
Content copied to clipboard
If the plugin is already installed, the configuration block will be applied to the existing configuration class.
Learn more from Plugins.
Installs an interceptor defined by block. The key parameter is used as a unique name, that also prevents installing duplicated interceptors.
If the key is already used, the new interceptor will replace the old one.
Applies all the installed plugins and customInterceptors from this configuration into the specified client.