mirror of
https://github.com/tenrok/axios.git
synced 2026-06-08 17:22:34 +03:00
Adding proxy to TypeScript definitions
This commit is contained in:
Vendored
+6
@@ -11,6 +11,11 @@ export interface AxiosBasicCredentials {
|
||||
password: string;
|
||||
}
|
||||
|
||||
export interface AxiosProxyConfig {
|
||||
host: string;
|
||||
port: number;
|
||||
}
|
||||
|
||||
export interface AxiosRequestConfig {
|
||||
url?: string;
|
||||
method?: string;
|
||||
@@ -35,6 +40,7 @@ export interface AxiosRequestConfig {
|
||||
maxRedirects?: number;
|
||||
httpAgent?: any;
|
||||
httpsAgent?: any;
|
||||
proxy?: AxiosProxyConfig;
|
||||
}
|
||||
|
||||
export interface AxiosResponse {
|
||||
|
||||
@@ -26,7 +26,11 @@ const config: AxiosRequestConfig = {
|
||||
onDownloadProgress: (progressEvent: any) => {},
|
||||
maxContentLength: 2000,
|
||||
validateStatus: (status: number) => status >= 200 && status < 300,
|
||||
maxRedirects: 5
|
||||
maxRedirects: 5,
|
||||
proxy: {
|
||||
host: '127.0.0.1',
|
||||
port: 9000
|
||||
}
|
||||
};
|
||||
|
||||
const handleResponse = (response: AxiosResponse) => {
|
||||
|
||||
Reference in New Issue
Block a user