Marcel Champagne
08/22/2020, 1:32 AM14 fun Application.module(testing: Boolean = false) {
15 val client = HttpClient(CIO)
16 val htmlContent = client.get<String>("<https://en.wikipedia.org/wiki/Main_Page>")
17 }
But I the the following error
Error:(16, 30) Kotlin: Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public inline operator fun <K, V> Map<out String, [ERROR : Explicit type argument expected for V]>.get(key: String): [ERROR : Explicit type argument expected for V]? defined in kotlin.collections
public operator fun MatchGroupCollection.get(name: String): MatchGroup? defined in kotlin.text
Marc Knaup
08/22/2020, 1:22 PMget
method first:
import io.ktor.client.request.*
And your function must be a `suspend fun`:
suspend fun Application.module(testing: Boolean = false) {