0.0.4 • Published 1 year ago

@jiangweiye/cloudflare-fetch v0.0.4

Weekly downloads
-
License
SEE LICENSE IN LI...
Repository
-
Last release
1 year ago

@jiangweiye/cloudflare-fetch

install

with pnpm

pnpm add @jiangweiye/cloudflare-fetch

with yarn

yarn add @jiangweiye/cloudflare-fetch

with npm

npm install @jiangweiye/cloudflare-fetch

type

import { AxiosErrorInterceptor, AxiosInterceptor, AxiosRequestConfig, AxiosResponse } from './types';

export declare class FetchClient {
    private requestInterceptors;
    private responseInterceptors;
    private errorInterceptors;
    request<T = any>(config: AxiosRequestConfig): Promise<AxiosResponse<T>>;
    get<T = any>(url: string, config?: Omit<AxiosRequestConfig, 'url' | 'method'>): Promise<AxiosResponse<T>>;
    post<T = any>(url: string, data?: any, config?: Omit<AxiosRequestConfig, 'url' | 'method' | 'body'>): Promise<AxiosResponse<T>>;
    put<T = any>(url: string, data?: any, config?: Omit<AxiosRequestConfig, 'url' | 'method' | 'body'>): Promise<AxiosResponse<T>>;
    delete<T = any>(url: string, config?: Omit<AxiosRequestConfig, 'url' | 'method'>): Promise<AxiosResponse<T>>;
    useRequestInterceptor(interceptor: AxiosInterceptor<AxiosRequestConfig>): void;
    useResponseInterceptor(interceptor: AxiosInterceptor<AxiosResponse<any>>): void;
    useErrorInterceptor(interceptor: AxiosErrorInterceptor): void;
    private parseHeaders;
}
export declare const fetchClient: FetchClient;
0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago