MCPcopy Index your code
hub / github.com/websocket-client/websocket-client / send

Method send

websocket/_core.py:289–304  ·  view source on GitHub ↗

Send the data as string. Parameters ---------- payload: str Payload must be utf-8 string or unicode, If the opcode is OPCODE_TEXT. Otherwise, it must be string(byte array). opcode: int Operation code (opcode) t

(self, payload: Union[bytes, str], opcode: int = ABNF.OPCODE_TEXT)

Source from the content-addressed store, hash-verified

287 raise
288
289 def send(self, payload: Union[bytes, str], opcode: int = ABNF.OPCODE_TEXT) -> int:
290 """
291 Send the data as string.
292
293 Parameters
294 ----------
295 payload: str
296 Payload must be utf-8 string or unicode,
297 If the opcode is OPCODE_TEXT.
298 Otherwise, it must be string(byte array).
299 opcode: int
300 Operation code (opcode) to send.
301 """
302
303 frame = ABNF.create_frame(payload, opcode)
304 return self.send_frame(frame)
305
306 def send_text(self, text_data: str) -> int:
307 """

Callers 15

send_textMethod · 0.95
send_bytesMethod · 0.95
send_binaryMethod · 0.95
pingMethod · 0.95
pongMethod · 0.95
send_closeMethod · 0.95
closeMethod · 0.95
test_proxy_connectMethod · 0.95
test_ssloptMethod · 0.95
test_sendMethod · 0.95
_sendMethod · 0.45
_sendFunction · 0.45

Calls 2

send_frameMethod · 0.95
create_frameMethod · 0.80

Tested by 3

test_proxy_connectMethod · 0.76
test_ssloptMethod · 0.76
test_sendMethod · 0.76