UNPKG

graphdb

Version:

Javascript client library supporting GraphDB and RDF4J REST API.

54 lines (53 loc) 1.44 kB
export = HttpResponse; /** * Wrapper for HTTP responses. * * Includes the HTTP client that performed the request and received the response * and the elapsed time in milliseconds. * * @class * @author Mihail Radkov */ declare class HttpResponse { /** * Constructs new wrapper with the supplied response and client. * @param {AxiosResponse} response the HTTP response * @param {HttpClient} httpClient client that performed the HTTP request */ constructor(response: AxiosResponse, httpClient: HttpClient); response: AxiosResponse; httpClient: HttpClient; /** * Returns the HTTP response's data. * * @return {string|any} the response data */ getData(): string | any; /** * Returns the HTTP response's headers. * * @return {{object}} the headers map */ getHeaders(): { object: any; }; /** * Sets the elapsed time of the request and response. * * @param {number} elapsedTime the elapsed time in milliseconds */ setElapsedTime(elapsedTime: number): void; elapsedTime: number; /** * Returns the elapsed time of the HTTP request execution. * * @return {number} the elapsed time in milliseconds */ getElapsedTime(): number; /** * Returns the base URL to which this request was performed. * * @return {string} the base URL */ getBaseURL(): string; }