Network node

WebSocket Request

Sends a JSON request and waits for ITS answer: a fresh id goes into the request (ID Field, e.g. id or d.requestId), and the reply carrying the same id comes out on Response, with Done, however many other messages arrive. The reply does not reach the Receive nodes. Timed Out pulses when no answer comes in Timeout seconds (0 = wait forever).

Inputs

PortTypeDefault
ConnectionThe Connection output of a WebSocket Client or Server.structure—
DataThe request, a JSON object (text or a JSON cable). Its id field is filled in for you; an id already there is kept.any
TriggerA rising edge sends one request. Several may wait at once; each answer comes back on its own Done pulse.boolfalse
ID FieldWhere the id goes in the request, a dotted path: id (JSON-RPC, Home Assistant), d.requestId (OBS).stringid
Response ID FieldWhere the answer carries the id. Empty = the same path as ID Field.string
TimeoutSeconds to wait for the answer before Timed Out pulses and the request is forgotten. 0 = wait forever.float5
TargetServer only: which client gets the request. Empty = all, a client id such as c2, or reply = the latest sender.string
EnableOff forgets every waiting request.booltrue

Outputs

PortType
Responseany
Donebool
Timed Outbool
Pendingint
Round Tripfloat
Request IDstring
Errorstring

Open WebSocket Request in the interactive catalog →

WebSocket Request is one of 381 nodes in Grafit Pro.

Free download. Every feature for 7 days, no card. Then €99.99 once — or keep playing your projects as a Player.

More Network nodes