UNPKG

@waiting/fetch

Version:

HTTP fetch API for browser and Node.js. Handle 302/303 redirect correctly on Node.js

18 lines 829 B
import type { Span } from '@opentelemetry/api'; import type { RequestInfo, RequestInit, Response } from 'undici'; import type { Args } from './types.js'; /** * fetch wrapper * * parameter init ignored during parameter input is typeof Request */ export declare function _fetch(input: RequestInfo, args: Args, requestInit: RequestInit, span?: Span): Promise<Response>; export declare function createRequest(input: RequestInfo, args: Args, requestInit: RequestInit, span?: Span): Promise<Response>; /** * Handle redirect case to retrieve cookies before jumping under Node.js. * There's no effect under Browser * * docs: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status */ export declare function handleRedirect(resp: Response, args: Args, init: RequestInit): Promise<Response>; //# sourceMappingURL=request.d.ts.map