File tree Expand file tree Collapse file tree 3 files changed +4
-5
lines changed
src/main/kotlin/com/ctrlhub/core/http Expand file tree Collapse file tree 3 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ repositories {
1818dependencies {
1919 implementation(libs.kotlin.reflect)
2020 implementation(libs.ktor.client.core)
21- implementation(libs.ktor.client.cio )
21+ implementation(libs.ktor.client.okhttp )
2222 implementation(libs.ktor.serialization.kotlinx.json)
2323 implementation(libs.ktor.client.content.negotiation)
2424 implementation(libs.ktor.logging.plugin)
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ jacksonKotlin = "2.18.2"
99
1010[libraries ]
1111ktor-client-core = { module = " io.ktor:ktor-client-core" , version.ref = " ktor" }
12- ktor-client-cio = { module = " io.ktor:ktor-client-cio " , version.ref = " ktor" }
12+ ktor-client-okhttp = { module = " io.ktor:ktor-client-okhttp " , version.ref = " ktor" }
1313ktor-client-content-negotiation = { module = " io.ktor:ktor-client-content-negotiation" , version.ref = " ktor" }
1414ktor-serialization-kotlinx-json = { module = " io.ktor:ktor-serialization-kotlinx-json" , version.ref = " ktor" }
1515ktor-logging-plugin = { module = " io.ktor:ktor-client-logging" , version.ref = " ktor" }
Original file line number Diff line number Diff line change @@ -3,15 +3,14 @@ package com.ctrlhub.core.http
33import com.ctrlhub.core.Config
44import io.ktor.client.HttpClient
55import io.ktor.client.HttpClientConfig
6- import io.ktor.client.engine.cio.CIO
6+ import io.ktor.client.engine.okhttp.OkHttp
77import io.ktor.client.plugins.UserAgent
88import io.ktor.client.plugins.contentnegotiation.ContentNegotiation
99import io.ktor.client.plugins.defaultRequest
1010import io.ktor.http.HttpHeaders
1111import io.ktor.serialization.kotlinx.json.json
1212import io.ktor.util.appendIfNameAbsent
1313import kotlinx.serialization.json.Json
14- import java.util.concurrent.atomic.AtomicReference
1514
1615/* *
1716 * A wrapper around the Ktor client. This allows default configuration
@@ -20,7 +19,7 @@ import java.util.concurrent.atomic.AtomicReference
2019 */
2120object KtorClientFactory {
2221 fun create (
23- httpClient : HttpClient = HttpClient (CIO ),
22+ httpClient : HttpClient = HttpClient (OkHttp ),
2423 configBlock : HttpClientConfig <* >.() -> Unit = {}
2524 ): HttpClient {
2625 return configureHttpClient(httpClient, configBlock)
You can’t perform that action at this time.
0 commit comments