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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user