import axios, {AxiosRequestConfig, AxiosResponse} from 'axios'; type RequestConfig = Omit & { params: Q; }; export const http = { get: ( url: string, config: RequestConfig ): Promise> => { return axios.get(url, config); }, delete: ( url: string, config: RequestConfig ): Promise> => { return axios.delete(url, config); }, head: ( url: string, config: RequestConfig ): Promise> => { return axios.head(url, config); }, options: ( url: string, config: RequestConfig ): Promise> => { return axios.options(url, config); }, post: ( url: string, body: Body, config: RequestConfig ): Promise> => { return axios.post(url, body, config); }, put: ( url: string, body: Body, config: RequestConfig ): Promise> => { return axios.post(url, body, config); }, patch: ( url: string, body: Body, config: RequestConfig ): Promise> => { return axios.post(url, body, config); }, };