> ## Documentation Index
> Fetch the complete documentation index at: https://docs.projectreal.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# WebSocket.Send

> WebSocket.connect tarafından döndürülen WebSocket object üzerinden bir Lua string gönderir. Method ilk argument olarak WebSocket table, ikinci argument olarak message string bekler. Object içindeki connection state değerini okur, bu object yoksa "WebSocket state is missing" fırlatır, state destroyed veya closed ise göndermeden döner ve varsayılan olarak CURLWS_TEXT ile ya da isteğe bağlı üçüncü argument boolean true ise CURLWS_BINARY ile curl_ws_send çağırır. values döndürmez ve gönderilen bytes sayısını raporlamaz.

<div className="real-function-page">
  ```lua theme={null}
  WebSocket.Send(socket: WebSocket, message: string, isBinary?: boolean)
  ```

  ## Argümanlar

  <ParamField path={"socket"} type={"WebSocket"} required>
    WebSocket.connect tarafından döndürülen WebSocket table. Send, WebSocket object methods üzerinden resolve edilir, bu yüzden belgelenen çağrı biçimi socket:Send(..).
  </ParamField>

  <ParamField path={"message"} type={"string"} required>
    explicit byte length ile curl\_ws\_send değerine geçirilen Lua string payload.
  </ParamField>

  <ParamField path={"isBinary"} type={"boolean"}>
    Bu argument varsa ve true ise Send CURLWS\_BINARY kullanır. Aksi halde CURLWS\_TEXT kullanır.
  </ParamField>

  ## Örnek

  Send text or binary data through a WebSocket object returned by WebSocket.connect.

  ```lua theme={null}
  local socket = WebSocket.connect("wss://example.com/socket")

  socket:Send("hello")
  socket:Send(string.char(0, 1, 2, 3), true)
  ```
</div>
