@fruitsjs/http
Version:
FruitsJS Generic Http Module
23 lines (21 loc) • 761 B
text/typescript
import {Http} from './http';
import {HttpAdapterAxios} from './httpAdapterAxios';
/**
* Factory for clients of [[Http]]
*
* @module http
*/
export class HttpClientFactory {
/**
* Creates an Http instance
*
* The current default implementation uses https://github.com/axios/axios
*
* @param baseUrl The base/root host url for the adapter, i.e. https://contoso.com
* @param options An arbitrary options object, depending on the implementation.
* As the default implementation uses axios the available options are here: https://axios-http.com/docs/req_config
*/
static createHttpClient(baseUrl: string, options?: any): Http {
return new HttpAdapterAxios(baseUrl, options);
}
}