1 |
|
2 | import { Agent } from 'http';
|
3 | import { IncomingHttpHeaders } from 'http';
|
4 | import Response = require('http-response-object');
|
5 | import { ICache, CachedResponse } from 'http-basic';
|
6 | import FormData = require('form-data');
|
7 | interface Options {
|
8 | allowRedirectHeaders?: string[];
|
9 | cache?: 'file' | 'memory' | ICache;
|
10 | agent?: boolean | Agent;
|
11 | followRedirects?: boolean;
|
12 | gzip?: boolean;
|
13 | headers?: IncomingHttpHeaders;
|
14 | maxRedirects?: number;
|
15 | maxRetries?: number;
|
16 | retry?: boolean | ((err: NodeJS.ErrnoException | null, res: Response<NodeJS.ReadableStream | Buffer | string> | void, attemptNumber: number) => boolean);
|
17 | retryDelay?: number | ((err: NodeJS.ErrnoException | null, res: Response<NodeJS.ReadableStream | Buffer | string> | void, attemptNumber: number) => number);
|
18 | socketTimeout?: number;
|
19 | timeout?: number;
|
20 | isMatch?: (requestHeaders: IncomingHttpHeaders, cachedResponse: CachedResponse, defaultValue: boolean) => boolean;
|
21 | isExpired?: (cachedResponse: CachedResponse, defaultValue: boolean) => boolean;
|
22 | canCache?: (res: Response<NodeJS.ReadableStream>, defaultValue: boolean) => boolean;
|
23 | qs?: {
|
24 | [key: string]: any;
|
25 | };
|
26 | json?: any;
|
27 | form?: FormData;
|
28 | body?: string | Buffer | NodeJS.ReadableStream;
|
29 | }
|
30 | export { Options };
|