Object - websub : Notification

Object representing the WebSub Content Delivery Request received.

getQueryParams

()

returns map

Retrieves the query parameters of the content delivery request as a map.

  • Return Type

    (map)
  • String-constrained array map of the query params

getEntity

()

returns Entity | error

Retrieves the Entity associated with the content delivery request.

  • Return Type

    (Entity | error)
  • The Entity of the request. An error is returned, if entity construction fails

hasHeader

(string headerName)

returns boolean

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

getHeader

(string headerName)

returns string

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 hasHeader() needs to be used to check the existence of header initially.

getHeaders

(string headerName)

returns string[]

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 hasHeader() needs to be used to check the existence of header initially.

getHeaderNames

()

returns string[]

Retrieves all the names of the headers present in the content delivery request.

  • Return Type

    (string[])
  • An array of all the header names

getContentType

()

returns string

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

getJsonPayload

()

returns json | error

Extracts json payload from the content delivery request.

  • Return Type

    (json | error)
  • The json payload or error in case of errors. If the content type is not JSON, an error is returned.

getXmlPayload

()

returns xml | error

Extracts xml payload from the content delivery request.

  • Return Type

    (xml | error)
  • The xml payload or error in case of errors. If the content type is not XML, an error is returned.

getTextPayload

()

returns string | error

Extracts text payload from the content delivery request.

  • Return Type

    (string | error)
  • The text payload or error in case of errors. If the content type is not of type text, an error is returned.

getByteChannel

()

returns ReadableByteChannel | error

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

getBinaryPayload

()

returns byte[] | error

Retrieves the request payload as a byte[].

  • Return Type

    (byte[] | error)
  • The byte[] representation of the message payload or error in case of errors

getFormParams

()

returns map | error

Retrieves the form parameters from the content delivery request as a map.

  • Return Type

    (map | error)
  • The map of form params or error in case of errors