vulcain-corejs
Version:
Vulcain micro-service framework
62 lines (61 loc) • 1.37 kB
TypeScript
/**
* This class provide a way to customize the http response.
*
* @export
* @class HttpResponse
*/
export declare class HttpResponse {
static readonly VulcainContentType: string;
/**
* Http code (default is 200)
*
* @type {number}
* @memberOf HttpResponse
*/
statusCode: number;
/**
* List of response headers
*
* @type {Map<string, string>}
* @memberOf HttpResponse
*/
headers: Map<string, string>;
/**
* Define a specific ContentType
*
* @type {string}
* @memberOf HttpResponse
*/
contentType: string;
/**
* Response content
*
* @type {*}
* @memberOf HttpResponse
*/
content: any;
/**
* Content encoding (like binary, hex,...)
*
* @type {string}
* @memberOf HttpResponse
*/
encoding: string;
constructor(content?: any, statusCode?: number);
/**
* Add a custom header value to the response
*
* @param {string} name
* @param {string} value
*/
addHeader(name: string, value: string): void;
}
export declare class HttpRedirectResponse extends HttpResponse {
constructor(url: string);
}
export declare class BadRequestResponse extends HttpResponse {
constructor(content: any);
}
export declare class VulcainResponse extends HttpResponse {
constructor(content: any);
}