Client: Caller

The caller actions for responding to client requests.

Remote Methods

respond

Sends the outbound response to the caller.

promise

Pushes a promise to the caller.

pushPromisedResponse

Sends a promised push response to the caller.

'continue

Sends a 100-continue response to the caller.

redirect

Sends a redirect response to the user with the specified redirection status code.

Methods

getRemoteHostName

Gets the hostname from the remote address.

Fields

  • remoteAddress Remote(default {})
  • The remote address

  • localAddress Local(default {})
  • The local address

  • protocol string(default "")
  • The protocol associated with the service endpoint

respond

function respond(ResponseMessage message) returns ListenerError?
Isolated Function
Remote Function

Sends the outbound response to the caller.

Parameters

  • message ResponseMessage (default ())
  • The outbound response or any allowed payload

Return Type

(ListenerError?)

An http:ListenerError if failed to respond or else ()

promise

function promise(PushPromise promise) returns ListenerError?
Isolated Function
Remote Function

Pushes a promise to the caller.

Parameters

Return Type

(ListenerError?)

An http:ListenerError in case of failures

pushPromisedResponse

function pushPromisedResponse(PushPromise promise, Response response) returns ListenerError?
Isolated Function
Remote Function

Sends a promised push response to the caller.

Parameters

Return Type

(ListenerError?)

An http:ListenerError in case of failures while responding with the promised response

'continue

function 'continue() returns ListenerError?
Isolated Function
Remote Function

Sends a 100-continue response to the caller.

Return Type

(ListenerError?)

An http:ListenerError if failed to send the 100-continue response or else ()

redirect

function redirect(Response response, RedirectCode code, string[ ] locations) returns ListenerError?
Isolated Function
Remote Function

Sends a redirect response to the user with the specified redirection status code.

Parameters

  • response Response
  • Response to be sent to the caller

  • locations string[ ]
  • An array of URLs to which the caller can redirect to

Return Type

(ListenerError?)

An http:ListenerError if failed to send the redirect response or else ()

getRemoteHostName

function getRemoteHostName() returns string?
Isolated Function

Gets the hostname from the remote address. This method may trigger a DNS reverse lookup if the address was created with a literal IP address.

1string? remoteHost = caller.getRemoteHostName();

Return Type

(string?)

The hostname of the address or else () if it is unresolved