rawPost
Posts one JSON-RPC call and returns the Response before the SDK reads its body. Use it in a proxy
that has to stream the body through rather than buffer it. ChatGateway uses it to
relay a chat reply.
The service pads a slow response with keepalive whitespace so that intermediaries don’t close the
connection mid-turn. A proxy that waits for the whole body holds that padding back and brings back
the timeout it’s there to prevent. Pass response.body on as it arrives.
Prefer the typed methods unless you are relaying bytes.
You own interpreting the result. On a slow turn the keepalive commits a 200 status before the
outcome is known, so an error can arrive under 200. Decide by the body, not the status: look
for an error member and compare its code with AI chat errors. Read the body to the end or cancel it, so the connection is
released. The client’s readIdleTimeoutSeconds applies to each read.
Parameters
method
The JSON-RPC method, for example chat.
params
The method’s parameters, sent as they are. The client wraps them in the JSON-RPC envelope and
supplies the request id.
Returns
Promise<Response> — the response, with its body unread.