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

ribesg

03/12/2019, 3:02 PM
It prints
kotlin.TypeCastException
when I create an
HttpClient
using this on iOS
Copy code
object HttpCliiFactory {

    fun create(
        config: HttpClientConfig<*>.() -> Unit = {},
        serializer: KotlinxSerializer.() -> Unit = {}
    ) =
        HttpClient {
            expectSuccess = false
            install(MyLoggingFeature)
            install(ExpectSuccess)
            install(JsonFeature) {
                this.serializer = KotlinxSerializer(Json.nonstrict).apply(serializer)
            }
            config()
        }

}
👀 1
Note that it works after that, it just prints that.
@e5l I just confirmed that it comes from
install(MyLoggingFeature)