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