Message
Description
Container of a series of Events that compose a whole message.
Message in itself is not an event. Instead, it's a convenient wrapper of an event series including a leading MessageStart event, an ending MessageEnd event and one or more Data events in between for the message body (or payload).
When a filter callback needs a Message, such as handleMessage, it'll wait and collect all those events composing a full message and combine them into a Message object for handling by the script. When a filter is to output a Message, it decomposes the object into a series of events representing the original full message.
Constructor
new Message(body?)
Creates an instance of Message.
new Message(head, body?, tail?)
Creates an instance of Message.
Properties
bodyMessage body as a Data object.
Protocol-dependent message header.
Value representation of the message body after decoding.
Protocol-dependent message footer.
Example
new Message({status: 200,statusText: 'OK',headers: {'content-type': 'text/plain'}},'Hello!')