typescriptkit
Version:
Basic functionality for TypeScript projects
30 lines (29 loc) • 1.06 kB
TypeScript
import { IHttpClient } from './IHttpClient';
import { IHttpRequestExecutor } from './IHttpRequestExecutor';
/**
* Implementation of the xmlHttpclient implementing async promises
*/
export declare class HttpClient implements IHttpClient {
private url;
private httpHeaders;
private httpRequestExecutor;
/**
* Set a value for the HttpHeaders for every request
* @param key name of the header
* @param value value of the header
*/
setHttpHeader(key: string, value: any): IHttpClient;
/**
* Implementation of the xmlHttpclient implementing async promises
* @param url The url to request to
* @param httpRequestExecutor (Optional) implementation of @see IHttpRequestExecutor to execute the requests with
*/
constructor(url: string, httpRequestExecutor?: IHttpRequestExecutor);
/**
* Send a HttpGet request to an endpoint
* @param path Uri extra path parameter
*/
httpGetAsync<TModel>(path?: string): Promise<TModel>;
private constructUrl(path);
}
export default HttpClient;