This commit is contained in:
vedhavyas committed 2019-09-23 23:37:59 +02:00
1 parent e56a2c5a85
commit 21208d42ac
6 files changed
+2 -2

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
// +build js,wasm
package main
import (
"fmt"
"net/http"
"syscall/js"
)
func call(this js.Value, args []js.Value) interface{} {
res, err := http.Get(args[0].String())
if err != nil {
panic(err)
}
f := fmt.Sprintln(res.Status, res.StatusCode, res.ContentLength)
err = res.Body.Close()
if err != nil {
panic(err)
}
return f
}
func main() {
js.Global().Set("call", js.FuncOf(call))
select {}
}
BIN
View File
Binary file not shown.