UNPKG

@farris/devkit-vue

Version:
40 lines (39 loc) 968 B
import { HttpMethod, HttpRequestConfig } from './types'; /** * HttpClient */ declare class HttpClient { /** * axios实例 */ private axiosInstance; /** * 构造函数 */ constructor(); /** * 发送GET请求 */ get(url: string, requestConfig: HttpRequestConfig): Promise<any>; /** * 发送POST请求 */ post(url: string, body: any, requestConfig: HttpRequestConfig): Promise<any>; /** * 发送PUT请求 */ put(url: string, body: any, requestConfig: HttpRequestConfig): Promise<any>; /** * 发送PATCH请求 */ patch(url: string, body: any, requestConfig: HttpRequestConfig): Promise<any>; /** * 发送DELETE请求 */ delete(url: string, requestConfig: HttpRequestConfig): Promise<any>; /** * 发送请求 */ request(method: HttpMethod, url: string, requestConfig: HttpRequestConfig): Promise<any>; } export { HttpClient };