1
0
mirror of https://github.com/taigrr/wasm-experiments synced 2025-01-18 04:03:21 -08:00

Update fetch testing

This commit is contained in:
Johan Brandhorst
2018-05-28 11:41:53 +01:00
parent d73473d0f6
commit b31231ab0a
9 changed files with 449 additions and 281 deletions

View File

@@ -6,6 +6,7 @@ import (
"fmt"
"io/ioutil"
"net/http"
"strings"
"github.com/johanbrandhorst/fetch"
)
@@ -14,7 +15,11 @@ func main() {
c := http.Client{
Transport: &fetch.Transport{},
}
resp, err := c.Get("https://api.github.com")
resp, err := c.Post(
"https://httpbin.org/anything",
"application/json",
strings.NewReader(`{"test":"test"}`),
)
if err != nil {
fmt.Println(err)
return