WEBSOCKET.SEND
This is a premium feature.
The WebSocket API is an advanced technology that makes it possible to open a two-way interactive communication session between the user(client) and the server. With this API, you can send messages to a server and receive event-driven responses without having to poll the server for a reply.
Sends a WebSocket message using the given WebSocket connection or URL. If an URL is given WEBSOCKET.SEND creates a new WebSocket connection using the URL. In this case, the incoming WebSocket messages are discarded. If you want to receive messages on the same connection use WEBSOCKET.CONNECT instead and use the returned WebSocket connection with WEBSOCKET.SEND.
Syntax
=WEBSOCKET.SEND(URL, [, Options, Target])
Arguments
Name | Description |
---|---|
UrlOrConnection | WebSocket connection created with WEBSOCKET.CONNECT or a URL. |
Message | The message to send. |
Return Value
TRUE, if no error.
Examples
Function | Result | Comment |
---|---|---|
=WEBSOCKET.SEND("ws://www.example.org",JSON(A1:B2)) | TRUE | Opens a WebSocket connection and send the given JSON. |