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
Entityof the request. Anerroris 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. An exception is thrown if no header is found. Ideally
Notification.hasHeader()needs to be used to check the existence of 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. An exception is thrown if no header is found. Ideally
Notification.hasHeader()needs to be used to check the existence of 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-typeheader value as a string
Extracts json payload from the content delivery request.
-
Return Type
(json | error) The
jsonpayload orerrorin case of errors. If the content type is not JSON, anerroris returned.
Extracts xml payload from the content delivery request.
-
Return Type
(xml | error) The
xmlpayload orerrorin case of errors. If the content type is not XML, anerroris returned.
Extracts text payload from the content delivery request.
-
Return Type
(string | error) The
textpayload orerrorin case of errors. If the content type is not of type text, anerroris 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
errorin case of errors
Retrieves the request payload as a byte[].
-
Return Type
(byte[] | error) The byte[] representation of the message payload or
errorin case of errors