Object -
websub
:
Notification
Represents the WebSub Content Delivery Request received.
Methods
mime:Entity
associated with the content delivery request.
json
payload from the content delivery request.
xml
payload from the content delivery request.
text
payload from the content delivery request.
ByteChannel
except in the case of multiparts.
byte[]
.
map
.
map<string[]> payload = notification.getTextPayload();
-
Return Type
(map) String-constrained array map of the query params
mime:Entity
associated with the content delivery request.
mime:Entity|error payload = notification.getEntity();
-
Return Type
(Entity | error) The
mime:Entity
of the request or else anerror
if entity construction fails
boolean payload = notification.hasHeader("name");
Parameters
- headerName string
-
The header name
-
Return Type
(boolean) true
if the specified header key exists or elsefalse
string payload = notification.getHeader("name");
Parameters
- headerName string
-
The header name
-
Return Type
(string) The first header value for the specified header name or else panic if no header is found. Ideally, the
Notification.hasHeader()
needs to be used to check the existence of a header initially.
string[] headersNames = notification.getHeaders("name");
Parameters
- headerName string
-
The header name
-
Return Type
(string[]) The header values the specified header key maps to or else panic if no header is found. Ideally, the
Notification.hasHeader()
needs to be used to check the existence of a header initially.
string[] headersNames = notification.getHeaderNames();
-
Return Type
(string[]) An array of all the header names
content-type
header value).
string contentType = notification.getContentType();
-
Return Type
(string) The
content-type
header value as astring
json
payload from the content delivery request.
json|error payload = notification.getJsonPayload();
-
Return Type
(json | error) The
json
payload or else anerror
in case of errors. If the content; type is not JSON, anerror
is returned.
xml
payload from the content delivery request.
xml|error result = notification.getXmlPayload();
-
Return Type
(xml | error) The
xml
payload or else anerror
in case of errors. If the content; type is not XML, anerror
is returned.
text
payload from the content delivery request.
string|error result = notification.getTextPayload();
-
Return Type
(string | error) The payload as a
text
or else anerror
in case of errors. If the content type is not of type text, anerror
is returned.
ByteChannel
except in the case of multiparts.
io:ReadableByteChannel|error result = notification.getByteChannel();
-
Return Type
(ReadableByteChannel | error) A byte channel from which the message payload can be read or esle an
error
in case of errors
byte[]
.
byte[]|error payload = notification.getBinaryPayload();
-
Return Type
(byte[] | error) The message payload as a
byte[]
or else anerror
in case of errors