Object -
websub
:
Notification
Object representing the WebSub Content Delivery Request received.
Methods
Retrieves the query parameters of the content delivery request as a map.
Retrieves the Entity
associated with the content delivery request.
Returns whether the requested header key exists in the header map of the content delivery request.
Returns the value of the specified header. If the specified header key maps to multiple values, the first of these values is returned.
Retrieves all the header values to which the specified header key maps to.
Retrieves all the names of the headers present in the content delivery request.
Retrieves the type of the payload of the content delivery request (i.e: the content-type
header value).
Extracts json
payload from the content delivery request.
Extracts xml
payload from the content delivery request.
Extracts text
payload from the content delivery request.
Retrieves the request payload as a ByteChannel
except in the case of multiparts.
Retrieves the request payload as a byte[]
.
Retrieves the form parameters from the content delivery request as a map
.
Retrieves the query parameters of the content delivery request as a map.
-
Return Type
(map) String-constrained array map of the query params
Retrieves the Entity
associated with the content delivery request.
-
Return Type
(Entity | error) The
Entity
of the request. Anerror
is returned, if entity construction fails
Returns whether the requested header key exists in the header map of the content delivery request.
Parameters
- headerName string
-
The header name
-
Return Type
(boolean) Returns true if the specified header key exists
Returns the value of the specified header. If the specified header key maps to multiple values, the first of these values is returned.
Parameters
- headerName string
-
The header name
-
Return Type
(string) The first header value for the specified header name. Panic if no header is found. Ideally, the
Notification.hasHeader()
needs to be used to check the existence of a header initially.
Retrieves all the header values to which the specified header key maps to.
Parameters
- headerName string
-
The header name
-
Return Type
(string[]) The header values the specified header key maps to. Panic if no header is found. Ideally, the
Notification.hasHeader()
needs to be used to check the existence of a header initially.
Retrieves all the names of the headers present in the content delivery request.
-
Return Type
(string[]) An array of all the header names
Retrieves the type of the payload of the content delivery request (i.e: the content-type
header value).
-
Return Type
(string) Returns the
content-type
header value as a string
Extracts json
payload from the content delivery request.
-
Return Type
(json | error) The
json
payload orerror
in case of errors. If the content type is not JSON, anerror
is returned.
Extracts xml
payload from the content delivery request.
-
Return Type
(xml | error) The
xml
payload orerror
in case of errors. If the content type is not XML, anerror
is returned.
Extracts text
payload from the content delivery request.
-
Return Type
(string | error) The
text
payload orerror
in case of errors. If the content type is not of type text, anerror
is returned.
Retrieves the request payload as a ByteChannel
except in the case of multiparts.
-
Return Type
(ReadableByteChannel | error) A byte channel from which the message payload can be read or
error
in case of errors
Retrieves the request payload as a byte[]
.
-
Return Type
(byte[] | error) The byte[] representation of the message payload or
error
in case of errors