@mcma/client
Version:
Node module with classes and functions used to access services in an MCMA environment
23 lines (22 loc) • 1.27 kB
TypeScript
import { AxiosResponse, AxiosRequestConfig } from "axios";
import { Authenticator } from "../auth";
import { Http } from "./http";
import { HttpRequestConfig } from "./http-request-config";
export type HttpClientConfig = {
maxAttempts?: number;
retryInterval?: number;
axiosConfig?: AxiosRequestConfig;
};
export declare class HttpClient implements Http {
private authenticator?;
private readonly config?;
private client;
constructor(authenticator?: Authenticator, config?: HttpClientConfig);
get<TResp = any>(urlOrConfig?: string | HttpRequestConfig, config?: HttpRequestConfig): Promise<AxiosResponse<TResp>>;
post<TResp = any, TReq = any>(body: TReq, urlOrConfig?: string | HttpRequestConfig, config?: HttpRequestConfig): Promise<AxiosResponse<TResp>>;
put<TResp = any, TReq = any>(body: TReq, urlOrConfig?: string | HttpRequestConfig, config?: HttpRequestConfig): Promise<AxiosResponse<TResp>>;
patch<TResp = any, TReq = any>(body: Partial<TReq>, urlOrConfig?: string | HttpRequestConfig, config?: HttpRequestConfig): Promise<AxiosResponse<TResp>>;
delete<TResp = any>(urlOrConfig?: string | HttpRequestConfig, config?: HttpRequestConfig): Promise<AxiosResponse<TResp>>;
private prepareRequest;
private request;
}