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.*
66import io.ktor.client.plugins.contentnegotiation.*
77import io.ktor.client.request.*
88import io.ktor.client.statement.*
9+ import io.ktor.http.HttpHeaders
910import io.ktor.serialization.kotlinx.json.*
11+ import io.ktor.util.appendIfNameAbsent
1012import kotlinx.serialization.encodeToString
1113import kotlinx.serialization.json.Json
1214
@@ -28,6 +30,9 @@ class KtorApiClient private constructor(val httpClient: HttpClient) {
2830 url(baseUrl)
2931 }
3032 }
33+ defaultRequest {
34+ headers.appendIfNameAbsent(HttpHeaders .ContentType , " application/json" )
35+ }
3136 expectSuccess = true
3237 install(ContentNegotiation ) {
3338 json(Json { ignoreUnknownKeys = true })
You can’t perform that action at this time.
0 commit comments