service-model
Version:
An object oriented web service framework inspired by Windows Communication Foundation.
41 lines (40 loc) • 1.05 kB
TypeScript
import { Url } from "./url";
import { HttpStatusCode } from "./httpStatusCode";
import { MessageHeaders } from "./messageHeaders";
/**
* Represents a request to or a response from a service.
*/
export declare class Message {
/**
* The url of the request message.
*/
url: Url;
/**
* The HTTP status code for a response message.
*/
statusCode: HttpStatusCode;
/**
* The HTTP method (GET, POST, etc.) for a request message.
*/
method: string;
/**
* The HTTP headers.
*/
headers: MessageHeaders;
/**
* The body of the message.
*/
body: any;
/**
* Constructs a message.
* @param body The body of the message.
* @params headers The headers for the message.
*/
constructor(body?: any, headers?: MessageHeaders);
/**
* Creates a reply message.
* @param status The HTTP status for the reply.
* @param body The body of the reply message.
*/
static createReply(status: HttpStatusCode, body?: any): Message;
}