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

25 lines
416 B
Go

package main
import (
"net/http"
"net/url"
"github.com/johanbrandhorst/wasm-experiments/fetch/fetch"
)
func main() {
headers := http.Header{}
headers.Add("Content-Type", "application/json")
req := fetch.Request{
URL: &url.URL{
Scheme: "http",
Host: "httpbin.org",
Path: "anything",
},
Method: fetch.POST,
Body: []byte(`{"key": "value"}`),
Headers: headers,
}
fetch.Fetch(req)
}