klyn.net.Socket.readAllText
method
public readAllText() as String throws IOException:
Description

Reads the whole socket stream as text.

The received transport bytes are returned unchanged; protocol status lines and headers are never rewritten by this low-level API.

import klyn.net

try socket = Socket("example.com", 80):
socket.write("GET / HTTP/1.1\r\nHost: example.com\r\nConnection: close\r\n\r\n")
print(socket.readAllText())
Throws
  • IOException if the socket stream is closed, disconnected, times out, or the underlying network I/O fails.