generator.client.vue.webapp.app.http.AxiosHttp.ts.mustache Maven / Gradle / Ivy
import type { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';
export type AxiosHttpResponse = AxiosResponse;
export class AxiosHttp {
constructor(private readonly axiosInstance: AxiosInstance) {}
async get(uri: string, config = {}): Promise> {
return this.axiosInstance.get(uri, config);
}
async put(uri: string, data?: Payload): Promise> {
return this.axiosInstance.put(uri, data);
}
async post(uri: string, data?: Payload, config?: AxiosRequestConfig): Promise> {
return this.axiosInstance.post(uri, data, config);
}
async delete(uri: string): Promise> {
return this.axiosInstance.delete(uri);
}
}