MCPcopy Create free account
hub / github.com/encode/starlette / receive_bytes

Method receive_bytes

starlette/websockets.py:129–134  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

127 return cast(str, message["text"])
128
129 async def receive_bytes(self) -> bytes:
130 if self.application_state != WebSocketState.CONNECTED:
131 raise WebSocketDisconnected('WebSocket is not connected. Need to call "accept" first.')
132 message = await self.receive()
133 self._raise_on_disconnect(message)
134 return cast(bytes, message["bytes"])
135
136 async def receive_json(self, mode: str = "text") -> Any:
137 if mode not in {"text", "binary"}:

Callers 7

iter_bytesMethod · 0.95
appFunction · 0.95
__call__Method · 0.95

Calls 3

receiveMethod · 0.95
_raise_on_disconnectMethod · 0.95