Clients - websub : Caller

The caller remote functions to respond to client requests.

Remote Methods

respond Sends the response to the caller.
 error? response = caller->respond();
ok Sends the response to the caller with the "200 OK" status.
 error? response = caller->ok();
accepted Sends the response to the caller with the "202 Accepted" status.
 error? response = caller->accepted();

respond

(ResponseMessage message)

returns error?
Sends the response to the caller.
 error? response = caller->respond();

Parameters

  • message ResponseMessage (default <(ballerina/http:Response|string|xml|json|byte[]|ballerina/io:ReadableByteChannel|ballerina/mime:Entity[])> ())
  • 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 <(ballerina/http:Response|string|xml|json|byte[]|ballerina/io:ReadableByteChannel|ballerina/mime:Entity[])> ())
  • 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 <(ballerina/http:Response|string|xml|json|byte[]|ballerina/io:ReadableByteChannel|ballerina/mime:Entity[])> ())
  • The response or any payload of the http:ResponseMessage type

  • Return Type

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