Skip to content

@loontail/minecraft-kit / FetchHttpClient

Class: FetchHttpClient

Defined in: src/http/client.ts:20

Default HttpClient implementation backed by Node's built-in fetch (undici under the hood). Maps fetch errors to MinecraftKitError.

Example

ts
import { FetchHttpClient, MinecraftKit } from "@loontail/minecraft-kit";

// Explicit instantiation — equivalent to leaving `httpClient` unset.
const kit = new MinecraftKit({ httpClient: new FetchHttpClient() });

Implements

Constructors

Constructor

ts
new FetchHttpClient(): FetchHttpClient;

Returns

FetchHttpClient

Methods

request()

ts
request(url, options?): Promise<HttpResponse>;

Defined in: src/http/client.ts:21

Parameters

ParameterType
urlstring
optionsHttpRequestOptions

Returns

Promise<HttpResponse>

Implementation of

ts
HttpClient.request

MIT License