HTTP Request from inside WASM using Anko's net/http package

This example uses net/http package.

See the output in browser developer console.

Actual code:


var http, ioutil = import("net/http"), import("io/ioutil")
res, _ = http.DefaultClient.Get("https://httpbin.org/anything")
b, _ = ioutil.ReadAll(res.Body)
println(toString(b))
res.Body.Close()

Info