Skip to content

Commit

Permalink
feat: exposed multipart-body axios functions
Browse files Browse the repository at this point in the history
  • Loading branch information
kpervin committed Feb 22, 2024
1 parent 9616f4b commit 8d2c806
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions lib/http.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,45 @@ export class HttpService {
return this.makeObservable<T>(this.instance.patch, url, data, config);
}

postForm<T = any, D = any>(
url: string,
data: D,
config?: AxiosRequestConfig<D>,
): Observable<AxiosResponse<T>>;
postForm<T = any>(
url: string,
data?: any,
config?: AxiosRequestConfig,
): Observable<AxiosResponse<T>> {
return this.makeObservable<T>(this.instance.postForm, url, data, config);
}

putForm<T = any, D = any>(
url: string,
data: D,
config?: AxiosRequestConfig<D>,
): Observable<AxiosResponse<T>>;
putForm<T = any>(
url: string,
data?: any,
config?: AxiosRequestConfig,
): Observable<AxiosResponse<T>> {
return this.makeObservable<T>(this.instance.putForm, url, data, config);
}

patchForm<T = any, D = any>(
url: string,
data: D,
config?: AxiosRequestConfig<D>,
): Observable<AxiosResponse<T>>;
patchForm<T = any>(
url: string,
data?: any,
config?: AxiosRequestConfig,
): Observable<AxiosResponse<T>> {
return this.makeObservable<T>(this.instance.patchForm, url, data, config);
}

get axiosRef(): AxiosInstance {
return this.instance;
}
Expand Down

0 comments on commit 8d2c806

Please sign in to comment.