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

tjb

02/17/2019, 12:01 AM
seems to be happening because of
Copy code
val client = HttpClient() {
    install(BasicAuth) {
      username = "test"
      password = "pass"
    }
    install(JsonFeature) {
      serializer = GsonSerializer()
    }
  }
b

bdawg.io

02/17/2019, 5:46 AM
What client engine do you have specified in your dependencies? (ie, CIO, Apache, OkHttp, etc)
t

tjb

02/17/2019, 5:42 PM
none that I can see this is what the plugin generates
Copy code
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
    compile "io.ktor:ktor-server-netty:$ktor_version"
    compile "ch.qos.logback:logback-classic:$logback_version"
    compile "io.ktor:ktor-server-core:$ktor_version"
    compile "io.ktor:ktor-auth:$ktor_version"
    compile "io.ktor:ktor-auth-jwt:$ktor_version"
    compile "io.ktor:ktor-jackson:$ktor_version"
    compile "io.ktor:ktor-client-core:$ktor_version"
    compile "io.ktor:ktor-client-core-jvm:$ktor_version"
    compile "io.ktor:ktor-client-auth-basic:$ktor_version"
    compile "io.ktor:ktor-client-json-jvm:$ktor_version"
    compile "io.ktor:ktor-client-gson:$ktor_version"
b

bdawg.io

02/17/2019, 5:56 PM
You need to add an engine, give
ktor-client-cio
a try https://ktor.io/clients/http-client/engines.html
Copy code
In the case of the JVM, the default engine is resolved with a ServiceLoader, getting the first one available. Thus depends on the artifacts you have included.