UNPKG

1.31 kBTypeScriptView Raw
1import { AxiosInstance } from "axios";
2import { ClientOptions, HttpClient } from "./models";
3export declare class AxiosHttpClient extends HttpClient {
4 client: AxiosInstance;
5 private errorHandler;
6 constructor(configOptions?: ClientOptions.Configuration);
7 /**
8 * Create http client instance with default settings.
9 *
10 * @return {AxiosInstance}
11 */
12 initHttpClient(configOptions?: ClientOptions.Configuration): void;
13 /**
14 * Process http request.
15 *
16 * @param method - Which type of http request will be executed.
17 * @param path - API URL endpoint.
18 * @param queryParameters - Querystring parameters used for http request.
19 * @param body - Data sent with http request.
20 */
21 httpRequest<T>(method: ClientOptions.HttpMethod, path: string, queryParameters: ({} | object), body: (null | object), requestHeaders: any): Promise<T>;
22 /**
23 * Process callback function for HTTP request.
24 *
25 * @param error - request error that needs to be transformed to proper Postmark error.
26 *
27 * @return {PostmarkError} - formatted Postmark error
28 */
29 private transformError;
30 /**
31 * Timeout in seconds is adjusted to Axios format.
32 *
33 * @private
34 */
35 private getRequestTimeoutInSeconds;
36 private adjustValue;
37}