package
Version:
v0.31.0
Opens a new window with list of versions in this module.
Published: Apr 29, 2024
License: Apache-2.0, MIT
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package fetch is a js fetch wrapper that avoids importing net/http.
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
defer cancel()
resp, err := fetch.Fetch("/some/api/call", &fetch.Opts{
Body: strings.NewReader(`{"one": "two"}`),
Method: fetch.MethodPost,
Signal: ctx,
})
Source Files
¶
Click to show internal directories.
Click to hide internal directories.