UNPKG

1.33 kBTypeScriptView Raw
1/// <reference types="node" />
2import { Agent } from 'http';
3import { IncomingHttpHeaders } from 'http';
4import Response = require('http-response-object');
5import { ICache, CachedResponse } from 'http-basic';
6import FormData = require('form-data');
7interface 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}
30export { Options };