Help us shape the future of Go! Take the 2026 Go Developer Survey

fetch

package
v1.34.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 3, 2026 License: MIT, MIT Imports: 0 Imported by: 0

README

Fetch

Wrapper for the Fetch API

Upstream

Upstream: https://github.com/marwan-at-work/wasm-fetch

Forked here. This sub-directory (only) is licensed MIT.

Documentation

Overview

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,
})

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL