Protocols
Saved & recent

JSON-RPC

Also called: JSON-RPC 2.0

JSON-RPC defines a compact request-and-response convention using JSON objects. A request names a method, can include parameters, and normally carries an ID that the response echoes. A response contains either a result or an error. The protocol does not prescribe a particular network transport.

A client could request an illustrative add operation with parameters 2 and 3 and ID 7, then match a result of 5 to that ID. A notification omits the ID and receives no JSON-RPC response. An ID matches exchanges; it does not by itself prevent a repeated call from repeating its effects.

Read first
Remote procedure call
Related
Remote procedure call, Correlation ID, Language Server Protocol, JSON-RPC notifications
Further reading
JSON-RPC Working Group — JSON-RPC 2.0 Specification
caller receiver request jsonrpc: "2.0" method: "add" params: [2, 3] id: 7 response jsonrpc: "2.0" result: 5 id: 7 call correlated result · id 7 separate notification jsonrpc: "2.0" method: "cursorMoved" no reply illustrative object excerpts
The response repeats request ID 7. A notification has no ID and receives no JSON-RPC response.

View in the full Protocols collection