@ima/plugin-rest-client
Version:
Generic REST API client plugin for the IMA application framework.
63 lines • 1.6 kB
TypeScript
/**
* Typed representation of a REST API response.
*/
export default class Response {
/**
* Initializes the response representation using the provided data.
*
* @param {{
* status: number
* headers: Object<string, string>
* body: *
* cached: boolean
* request: Request
* }} responseData The data representing this response. See the
* fields of this class for more information.
*/
constructor(responseData: {
status: number;
headers: {
[x: string]: string;
};
body: any;
cached: boolean;
request: Request;
});
/**
* The HTTP response status code of this response.
*
* @type {number}
*/
status: number;
/**
* The response headers. The keys are header names in lower-case, the
* values are header values.
*
* @type {Object<string, string>}
*/
headers: {
[x: string]: string;
};
/**
* The response of the body, already parsed according to the value of
* the response's {@code Content-Type} header.
*
* @type {*}
*/
body: any;
/**
* The flag signalling whether this request was handled by the HTTP
* agent's cache.
*
* @type {boolean}
*/
cached: boolean;
/**
* The REST API request that was made and resulted in this response.
*
* @type {Request}
*/
request: Request;
}
import Request from './Request';
//# sourceMappingURL=Response.d.ts.map