Skip to main content
Version: Streamsheets 2.5

WEBSOCKET.SEND

star 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

NameDescription
UrlOrConnectionWebSocket connection created with WEBSOCKET.CONNECT or a URL.
MessageThe message to send.

Return Value

TRUE, if no error.

Examples

FunctionResultComment
=WEBSOCKET.SEND("ws://www.example.org",JSON(A1:B2))TRUEOpens a WebSocket connection and send the given JSON.