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 {
18
18
dependencies {
19
19
implementation(libs.kotlin.reflect)
20
20
implementation(libs.ktor.client.core)
21
- implementation(libs.ktor.client.cio )
21
+ implementation(libs.ktor.client.okhttp )
22
22
implementation(libs.ktor.serialization.kotlinx.json)
23
23
implementation(libs.ktor.client.content.negotiation)
24
24
implementation(libs.ktor.logging.plugin)
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ jacksonKotlin = "2.18.2"
9
9
10
10
[libraries ]
11
11
ktor-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" }
13
13
ktor-client-content-negotiation = { module = " io.ktor:ktor-client-content-negotiation" , version.ref = " ktor" }
14
14
ktor-serialization-kotlinx-json = { module = " io.ktor:ktor-serialization-kotlinx-json" , version.ref = " ktor" }
15
15
ktor-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
3
3
import com.ctrlhub.core.Config
4
4
import io.ktor.client.HttpClient
5
5
import io.ktor.client.HttpClientConfig
6
- import io.ktor.client.engine.cio.CIO
6
+ import io.ktor.client.engine.okhttp.OkHttp
7
7
import io.ktor.client.plugins.UserAgent
8
8
import io.ktor.client.plugins.contentnegotiation.ContentNegotiation
9
9
import io.ktor.client.plugins.defaultRequest
10
10
import io.ktor.http.HttpHeaders
11
11
import io.ktor.serialization.kotlinx.json.json
12
12
import io.ktor.util.appendIfNameAbsent
13
13
import kotlinx.serialization.json.Json
14
- import java.util.concurrent.atomic.AtomicReference
15
14
16
15
/* *
17
16
* A wrapper around the Ktor client. This allows default configuration
@@ -20,7 +19,7 @@ import java.util.concurrent.atomic.AtomicReference
20
19
*/
21
20
object KtorClientFactory {
22
21
fun create (
23
- httpClient : HttpClient = HttpClient (CIO ),
22
+ httpClient : HttpClient = HttpClient (OkHttp ),
24
23
configBlock : HttpClientConfig <* >.() -> Unit = {}
25
24
): HttpClient {
26
25
return configureHttpClient(httpClient, configBlock)
You can’t perform that action at this time.
0 commit comments