gaxios.d.ts
1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { GaxiosOptions, GaxiosPromise } from './common';
export declare class Gaxios {
private agentCache;
/**
* Default HTTP options that will be used for every HTTP request.
*/
defaults: GaxiosOptions;
/**
* The Gaxios class is responsible for making HTTP requests.
* @param defaults The default set of options to be used for this instance.
*/
constructor(defaults?: GaxiosOptions);
/**
* Perform an HTTP request with the given options.
* @param opts Set of HTTP options that will be used for this HTTP request.
*/
request<T = any>(opts?: GaxiosOptions): GaxiosPromise<T>;
private _defaultAdapter;
/**
* Internal, retryable version of the `request` method.
* @param opts Set of HTTP options that will be used for this HTTP request.
*/
private _request;
private getResponseData;
/**
* Validates the options, and merges them with defaults.
* @param opts The original options passed from the client.
*/
private validateOpts;
/**
* By default, throw for any non-2xx status code
* @param status status code from the HTTP response
*/
private validateStatus;
/**
* Encode a set of key/value pars into a querystring format (?foo=bar&baz=boo)
* @param params key value pars to encode
*/
private paramsSerializer;
private translateResponse;
}