Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

FetchOptions

interface FetchOptions <R extends ResponseType = ResponseType> extends Omit<RequestInit, "body"> {
baseURL?: string;
body?: RequestInit["body"] | Record<string, any>;
ignoreResponseError?: boolean;
parseResponse?: (responseText: string) => any;
response?: boolean;
responseType?: R;
retry?: number | false;
onRequest?(context: FetchContext): Promise<void> | void;
onRequestError?(context: FetchContext & {
error: Error;
}
): Promise<void> | void;
onResponse?(context: FetchContext & {
response: FetchResponse<R>;
}
): Promise<void> | void;
onResponseError?(context: FetchContext & {
response: FetchResponse<R>;
}
): Promise<void> | void;
}

§Type Parameters

§
R extends ResponseType = ResponseType
[src]

§Extends

§
Omit<RequestInit, "body">
[src]

§Properties

§
baseURL?: string
[src]
§
body?: RequestInit["body"] | Record<string, any>
[src]
§
ignoreResponseError?: boolean
[src]
§
parseResponse?: (responseText: string) => any
[src]
§
response?: boolean
[src]
§
responseType?: R
[src]
§
retry?: number | false
[src]

§Methods

§
onRequest?(context: FetchContext): Promise<void> | void
[src]
§
onRequestError?(context: FetchContext & {
error: Error;
}
): Promise<void> | void
[src]
§
onResponse?(context: FetchContext & {
response: FetchResponse<R>;
}
): Promise<void> | void
[src]
§
onResponseError?(context: FetchContext & {
response: FetchResponse<R>;
}
): Promise<void> | void
[src]