Skip to main content
handleRpc(req, method?): Promise<Response>
Dispatch one RPC over POST (see the class doc for the URL contract). The request body is the argument list: a plain JSON array, or the SDK codec’s encoded form of one ({"json": […], …}) when rich values need to round-trip. The answer is the result or error frame — the same frame a WebSocket caller would receive — with the HTTP status mapped from the error code (the code strings themselves are unchanged). The call runs through the socket server’s own gates, in bootstrap order — onConnect, authorize (Authorization: Bearer preferred, token query parameter otherwise), onAttach, then the "rpc" claim gate — but it holds NO connection: no snapshot source is read for it, it is never counted as a watcher, and broadcasts never reach it. A gate that refuses the call answers exactly like a refused connection (see the class doc’s rejection shapes). Parameters Returns Promise<Response> The call’s answer frame as JSON.