query
Connects to a TCP service, writes the request and reads until EOF.
Loopback needs network; a remote host also needs network.outbound. The request is at most 2048 UTF-8 bytes; a newline is appended. The response is at most {@value #MAX_RESPONSE_BYTES} bytes and the timeout is capped at {@value #MAX_TIMEOUT_MS} ms, including DNS resolution. The read runs to EOF, so a server that keeps the connection open after sending 8 KiB yields a java.net.SocketTimeoutException rather than a truncated result.
Return
the response text
Since
api 2
Parameters
a loopback name, a host name or an IP address
the port, 1–65535
the request, or null for none
the timeout; capped at {@value #MAX_TIMEOUT_MS}
Throws
on connect, write, resolve, read or request-size failure
if the required permission is not granted