File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
src/main/kotlin/com/ctrlhub/core/api Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,9 @@ import io.ktor.client.plugins.*
6
6
import io.ktor.client.plugins.contentnegotiation.*
7
7
import io.ktor.client.request.*
8
8
import io.ktor.client.statement.*
9
+ import io.ktor.http.HttpHeaders
9
10
import io.ktor.serialization.kotlinx.json.*
11
+ import io.ktor.util.appendIfNameAbsent
10
12
import kotlinx.serialization.encodeToString
11
13
import kotlinx.serialization.json.Json
12
14
@@ -28,6 +30,9 @@ class KtorApiClient private constructor(val httpClient: HttpClient) {
28
30
url(baseUrl)
29
31
}
30
32
}
33
+ defaultRequest {
34
+ headers.appendIfNameAbsent(HttpHeaders .ContentType , " application/json" )
35
+ }
31
36
expectSuccess = true
32
37
install(ContentNegotiation ) {
33
38
json(Json { ignoreUnknownKeys = true })
You can’t perform that action at this time.
0 commit comments