zt
09/19/2022, 2:42 AMNorbi
09/19/2022, 7:37 AMHttpClient should be customizable by the library user. On the other side, there may be some requirements regarding the HttpClient configuration by the library (eg. some plugins must be installed for the library to function properly).ayodele
09/20/2022, 5:33 PMzt
09/20/2022, 5:34 PMayodele
09/20/2022, 5:40 PMengine should be initiated as needed. This will help you avoid bloating up the client project if they are only using it on maybe 2 platformszt
09/21/2022, 11:14 PMAleksei Tirman [JB]
09/28/2022, 10:53 AMHttpClient type that you can use to create a clone of an HttpClient with the ContentNegotiation plugin installed by using the HttpClient.config method.zt
10/01/2022, 1:05 AMval ktorVersion = "2.1.2"
val commonMain by getting {
dependencies {
implementation("io.ktor:ktor-client-core:$ktorVersion")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.0")
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.0")
implementation("io.ktor:ktor-client-content-negotiation:$ktorVersion")
implementation("io.ktor:ktor-serialization-kotlinx-json:$ktorVersion")
}
}
val jvmMain by getting {
dependencies {
implementation("io.ktor:ktor-client-cio:$ktorVersion")
}
}
val jsTest by getting {
dependencies {
implementation("io.ktor:ktor-client-js:$ktorVersion")
}
}
val nativeMain by getting {
dependencies {
implementation("io.ktor:ktor-client-curl:$ktorVersion")
}
}