2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-05 16:42:32 +03:00

Merge pull request #1401 from ascott18/patch-1

[Typescript] Fix missing type parameters on delete/head methods
This commit is contained in:
Nick Uraltsev
2018-03-08 07:56:53 -08:00
committed by GitHub
2 changed files with 10 additions and 2 deletions
Vendored
+2 -2
View File
@@ -110,8 +110,8 @@ export interface AxiosInstance {
};
request<T = any>(config: AxiosRequestConfig): AxiosPromise<T>;
get<T = any>(url: string, config?: AxiosRequestConfig): AxiosPromise<T>;
delete(url: string, config?: AxiosRequestConfig): AxiosPromise;
head(url: string, config?: AxiosRequestConfig): AxiosPromise;
delete<T = any>(url: string, config?: AxiosRequestConfig): AxiosPromise<T>;
head<T = any>(url: string, config?: AxiosRequestConfig): AxiosPromise<T>;
post<T = any>(url: string, data?: any, config?: AxiosRequestConfig): AxiosPromise<T>;
put<T = any>(url: string, data?: any, config?: AxiosRequestConfig): AxiosPromise<T>;
patch<T = any>(url: string, data?: any, config?: AxiosRequestConfig): AxiosPromise<T>;
+8
View File
@@ -120,6 +120,14 @@ axios.get<User>('/user', { params: { id: 12345 } })
.then(handleUserResponse)
.catch(handleError);
axios.head<User>('/user')
.then(handleResponse)
.catch(handleError);
axios.delete<User>('/user')
.then(handleResponse)
.catch(handleError);
axios.post<User>('/user', { foo: 'bar' })
.then(handleUserResponse)
.catch(handleError);