Skip to content

Commit

Permalink
Merge pull request #1031 from kpervin/fea/multipart-bodies
Browse files Browse the repository at this point in the history
feat: exposed multipart-body axios functions
  • Loading branch information
kamilmysliwiec authored Oct 21, 2024
2 parents faf41c7 + cdd7ce3 commit b232d92
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, D>>;
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, D>>;
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, D>>;
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 b232d92

Please sign in to comment.