Constructor
new HTTPEmitter(optionsopt)
Creates a new instance of {HTTPEmitter}. The default emitter uses the 1.0 protocol specification in binary mode.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
The configuration options for this event emitter Properties
|
- Source:
- See:
Throws:
-
if no options.url is provided or an unknown specification version is provided.
- Type
- TypeError
Methods
headers(event) → {Object}
Returns the HTTP headers that will be sent for this event when the HTTP transmission mode is "binary". Events sent over HTTP in structured mode only have a single CE header and that is "ce-id", corresponding to the event ID.
Parameters:
Name | Type | Description |
---|---|---|
event |
CloudEvent |
a CloudEvent |
- Source:
send(event, optionsopt) → {Promise}
Sends the {CloudEvent} to an event receiver over HTTP POST
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
event |
CloudEvent |
the CloudEvent to be sent |
|||||||||||||
options |
Object |
<optional> |
The configuration options for this event. Options
provided will be passed along to Node.js Properties
|
- Source: