HTTP Request from inside WASM using Kotlin

See the output in browser developer console.

Actual code:


import kotlinx.browser.window

fun main() {
    window.fetch("https://httpbin.org/anything").then {
        if (it.ok) {
            it.text().then {
                println(it)
                null
            }
        }
        null
    }
}

Info