https://kotlinlang.org logo
#ktor
Title
# ktor
e

Evan

01/07/2021, 10:04 PM
Anyone know why I’m getting a
kotlinx.coroutines.TimeoutCancellationException
on my request?
Copy code
kotlinx.coroutines.TimeoutCancellationException: Timed out waiting for 15000 ms
My
HttpClient
is configured as follows:
Copy code
val jsonClient = HttpClient() {
        install(JsonFeature) {
            serializer = KotlinxSerializer(Json {
                isLenient = true
                ignoreUnknownKeys = true
            })
        }
        install(Logging) {
            logger = io.ktor.client.features.logging.Logger.DEFAULT
            level = if (configuration.loggingEnabled) LogLevel.ALL else LogLevel.NONE
        }
        install(HttpTimeout) {
            connectTimeoutMillis = 60000
            socketTimeoutMillis = 60000
            requestTimeoutMillis = 60000
        }
        expectSuccess = false
    }