HTTP requests in Go
Golem implements the WASI HTTP (opens in a new tab) interfaces so any library built on this specification can be used from Golem components to communicate with external services.
By using the Golem Go SDK, Go's built-in net/http
package can be configured to use the WASI HTTP interfaces.
To do so, simply import and set Golem's Roundtrip
implementation:
import (
"github.com/golemcloud/golem-go/roundtrip"
"net/http"
)
http.DefaultClient.Transport = roundtrip.WasiHttpTransport{};