UNPKG

@signumjs/http

Version:
32 lines (31 loc) 1.28 kB
import { AxiosRequestConfig } from 'axios'; import { HttpResponse } from './httpResponse'; import { Http } from './http'; /** * Http Implementation of {@link Http} using https://github.com/axios/axios * * Prefer {@link HttpClientFactory.createHttpClient} to create an instance * * @module http */ export declare class HttpAdapterAxios implements Http { private readonly _clientImpl; /** * Creates your Http client * @param baseURL The baseUrl, i.e host url * @param options [optional] An options/configurations object applied to all requests * The current implementation uses axios, so the options can be found here * [Axios Configuration](https://github.com/axios/axios#request-config) */ constructor(baseURL: string, options?: AxiosRequestConfig); /** * @internal * @param url The url * @param error The returned error */ private static mountError; get(url: string, options?: any | AxiosRequestConfig): Promise<HttpResponse>; post(url: string, payload: any, options?: any | AxiosRequestConfig): Promise<HttpResponse>; put(url: string, payload: any, options?: any | AxiosRequestConfig): Promise<HttpResponse>; delete(url: string, options?: any | AxiosRequestConfig): Promise<HttpResponse>; }