This API documentation is for Ballerina 1.2.0. View API documentation for the latest release.

Clients - websub : Caller

The caller remote functions to respond to client requests.

Remote Methods

respond

Sends the response to the caller.

ok

Sends the response to the caller with the "200 OK" status.

accepted

Sends the response to the caller with the "202 Accepted" status.

respond

(ResponseMessage message)

returns error?

Sends the response to the caller.

 error? response = caller->respond();

Parameters

  • message ResponseMessage (default ())
  • The response or any payload of type string, xml, json, byte[], io:ReadableByteChannel, or mime:Entity[]

  • Return Type

    (error?)
  • An error on failure or else ()

ok

(ResponseMessage message)

returns error?

Sends the response to the caller with the "200 OK" status.

 error? response = caller->ok();

Parameters

  • message ResponseMessage (default ())
  • The response or any payload of type string, xml, json, byte[], io:ReadableByteChannel, or mime:Entity[]

  • Return Type

    (error?)
  • An error on failure or else ()

accepted

(ResponseMessage message)

returns error?

Sends the response to the caller with the "202 Accepted" status.

 error? response = caller->accepted();

Parameters

  • message ResponseMessage (default ())
  • The response or any payload of the http:ResponseMessage type

  • Return Type

    (error?)
  • An error on failure or else ()