Skip to content
module@warp-drive/core

Handler Fetch ​

ts
const Fetch: {
  request: Promise<T>;
};

Defined in: warp-drive-packages/core/src/request/-private/fetch.ts:139

ts
import { Fetch } from '@warp-drive/core';

A basic Fetch Handler which converts a request into a fetch call presuming the response to be json.

The Making Requests guide shows where it sits in the handler chain.

ts
import { RequestManager, Fetch } from '@warp-drive/core';

const manager = new RequestManager()
  .use([Fetch]);

Type Declaration ​

request() ​

ts
request<T>(context: Context): Promise<T>;

Issues the request via native fetch, setting the response and (when requested) streaming the decoded body via Context.setStream as it downloads, then resolves with the parsed JSON body.

Type Parameters ​

T ​

T

Parameters ​

context ​

Context

Returns ​

Promise<T>

Released under the MIT License.