Constructor
new StructuredHTTPReceiver(version)
Creates a new StructuredHTTPReceiver. Supports Cloud Events specification versions 0.3 and 1.0 (default).
Parameters:
Name | Type | Description |
---|---|---|
version |
string |
the Cloud Events specification version. Default: 1.0. |
- Source:
- See:
-
- {StructuredReceiver}
Methods
check(payload, headers) → {boolean}
Checks whether the provided payload and headers conform to the Cloud Events specification version supported by this instance.
Parameters:
Name | Type | Description |
---|---|---|
payload |
object |
the cloud event data payload |
headers |
object |
the HTTP headers received for this cloud event |
Throws:
-
if the payload and header combination do not conform to the spec
- Type
- ValidationError
parse(payload, headers) → {CloudEvent}
Creates a new CloudEvent instance based on the provided payload and headers.
Parameters:
Name | Type | Description |
---|---|---|
payload |
object |
the cloud event data payload |
headers |
object |
the HTTP headers received for this cloud event |
Throws:
-
if the payload and header combination do not conform to the spec
- Type
- ValidationError