FetchOptions
interface FetchOptions <R extends ResponseType = ResponseType> extends Omit<RequestInit, "body"> {
baseURL?: string;
body?: RequestInit["body"] | Record<string, any>;
ignoreResponseError?: boolean;
params?: SearchParameters;
parseResponse?: (responseText: string) => any;
query?: SearchParameters;
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;§Methods
§
onRequest?(context: FetchContext): Promise<void> | void
[src]§
onRequestError?(context: FetchContext & {
[src]error: Error;
}): Promise<void> | void§
onResponse?(context: FetchContext & {
[src]response: FetchResponse<R>;
}): Promise<void> | void§
onResponseError?(context: FetchContext & {
[src]response: FetchResponse<R>;
}): Promise<void> | void