StructuredHTTPEmitter

StructuredHTTPEmitter

const { DATA_ATTRIBUTE, DEFAULT_CE_CONTENT_TYPE, HEADERS, HEADER_CONTENT_TYPE } = require("./constants.js");

const defaults = { [HEADERS]: { [HEADER_CONTENT_TYPE]: DEFAULT_CE_CONTENT_TYPE }, method: "POST" };

/** A class for sending {CloudEvent} instances over HTTP.

Constructor

new StructuredHTTPEmitter()

Source:

Methods

(async) emit(options, cloudevent) → {Promise}

Sends the event over HTTP

Parameters:
Name Type Description
options Object

The configuration options for this event. Options provided will be passed along to Node.js http.request(). https://nodejs.org/api/http.html#http_http_request_options_callback

Properties
Name Type Description
url URL

The HTTP/S url that should receive this event

cloudevent CloudEvent

The CloudEvent to be sent

Source: