client
Package client provides an axios/fetch-style HTTP client over net/http. Node equivalent: axios, node-fetch.
import "github.com/sahilkhaire/gox/client"
Select a symbol below — each page explains what it does, shows Node.js vs Go comparisons, and includes a runnable example.
Functions
| Symbol | Node.js | Kind | Summary |
|---|---|---|---|
| SetDefaultClient | — | func | SetDefaultClient replaces the client used by Fetch. |
Types
| Symbol | Node.js | Kind | Summary |
|---|---|---|---|
| Client | — | type | Client is a reusable HTTP client with defaults (axios instance). |
| RequestOpts | — | type | RequestOpts configures a single request. |
| Response | — | type | Response wraps an HTTP response. |
Methods
| Symbol | Node.js | Kind | Summary |
|---|---|---|---|
| Response.Fetch | fetch(url) | method | Fetch is a fetch()-style helper using the package default client. |
| RequestOpts.JSONBody | — | method | JSONBody returns RequestOpts with a JSON body. |
| Client.New | axios.create() | method | New creates a Client with optional timeout. |
| RequestOpts.WithHeaders | — | method | WithHeaders returns RequestOpts with headers. |
| RequestOpts.WithMethod | — | method | WithMethod sets method on opts (helper for Fetch). |
| RequestOpts.WithQuery | — | method | WithQuery returns RequestOpts with query values. |