All Downloads are FREE. Search and download functionalities are using the official Maven repository.

generator.client.vue.webapp.app.http.AxiosHttp.ts.mustache Maven / Gradle / Ivy

There is a newer version: 1.22.0
Show newest version
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);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy