Clients -
http :
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. |
| acceptWebSocketUpgrade | Sends an upgrade request with custom headers. |
| cancelWebSocketUpgrade | Cancels the handshake. |
| continue | Sends a |
| redirect | Sends a redirect response to the user with the specified redirection status code. |
| ok | Sends the outbound response to the caller with the status 200 OK. |
| created | Sends the outbound response to the caller with the status 201 Created. |
| accepted | Sends the outbound response to the caller with the status 202 Accepted. |
Fields
Sends the outbound response to the caller.
Parameters
- message ResponseMessage (default ())
-
The outbound response or any payload of type
string,xml,json,byte[],io:ReadableByteChannelormime:Entity[]
-
Return Type
(ListenerError?) Returns an
http:ListenerErrorif failed to respond
Pushes a promise to the caller.
Parameters
- promise PushPromise
-
Push promise message
-
Return Type
(ListenerError?) An
http:ListenerErrorin case of failures
Sends a promised push response to the caller.
-
Return Type
(ListenerError?) An
http:ListenerErrorin case of failures while responding with the promised response
Sends an upgrade request with custom headers.
Parameters
- headers map
-
A
mapof custom headers for handshake
-
Return Type
(WebSocketCaller | WebSocketError) WebSocketCalleror error on failure to upgrade
Cancels the handshake.
Parameters
- status int
-
Error Status code for cancelling the upgrade and closing the connection. This error status code need to be 4xx or 5xx else the default status code would be 400.
- reason string
-
Reason for cancelling the upgrade
-
Return Type
(WebSocketError?) An
errorif an error occurs during cancelling the upgrade or nil
Sends a 100-continue response to the caller.
-
Return Type
(ListenerError?) Returns an
http:ListenerErrorif failed to send the100-continueresponse
Sends a redirect response to the user with the specified redirection status code.
Parameters
- response Response
-
Response to be sent to the caller
- code RedirectCode
-
The redirect status code to be sent
- locations string[]
-
An array of URLs to which the caller can redirect to
-
Return Type
(ListenerError?) Returns an
http:ListenerErrorif failed to send the redirect response
Sends the outbound response to the caller with the status 200 OK.
Parameters
- message ResponseMessage (default ())
-
The outbound response or any payload of type
string,xml,json,byte[],io:ReadableByteChannelormime:Entity[]
-
Return Type
(ListenerError?) Returns an
http:ListenerErrorif failed to respond
Sends the outbound response to the caller with the status 201 Created.
Parameters
- uri string
-
Represents the most specific URI for the newly created resource
- message ResponseMessage (default ())
-
The outbound response or any payload of type
string,xml,json,byte[],io:ReadableByteChannelormime:Entity[]. This message is optional.
-
Return Type
(ListenerError?) Returns an
http:ListenerErrorif failed to respond
Sends the outbound response to the caller with the status 202 Accepted.
Parameters
- message ResponseMessage (default ())
-
The outbound response or any payload of type
string,xml,json,byte[],io:ReadableByteChannelormime:Entity[]. This message is optional.
-
Return Type
(ListenerError?) Returns an
http:ListenerErrorif failed to respond