Skip to content
Node: axios, fetch10 APIs

client

Package client provides an axios/fetch-style HTTP client over net/http. Node equivalent: axios, node-fetch.

import "github.com/sahilkhaire/gox/client"
## API reference

Select a symbol below — each page explains what it does, shows Node.js vs Go comparisons, and includes a runnable example.

Functions ​

SymbolNode.jsKindSummary
SetDefaultClient—funcSetDefaultClient replaces the client used by Fetch.

Types ​

SymbolNode.jsKindSummary
Client—typeClient is a reusable HTTP client with defaults (axios instance).
RequestOpts—typeRequestOpts configures a single request.
Response—typeResponse wraps an HTTP response.

Methods ​

SymbolNode.jsKindSummary
Response.Fetchfetch(url)methodFetch is a fetch()-style helper using the package default client.
RequestOpts.JSONBody—methodJSONBody returns RequestOpts with a JSON body.
Client.Newaxios.create()methodNew creates a Client with optional timeout.
RequestOpts.WithHeaders—methodWithHeaders returns RequestOpts with headers.
RequestOpts.WithMethod—methodWithMethod sets method on opts (helper for Fetch).
RequestOpts.WithQuery—methodWithQuery returns RequestOpts with query values.

MIT Licensed · Built for Node.js developers moving to Go