🔌JSON-RPC
Also known as JSON-RPC 2.0, JSON Remote Procedure Call
A way for one program to ask another to do a job. The note is in JSON.
Think of it like
Think of it like a note that says which job to do and what to use. The answer note has the same number.
Example
Why it matters
Definition
Example code
json
{ "jsonrpc": "2.0", "method": "add", "params": [3, 4], "id": 1 }
{ "jsonrpc": "2.0", "result": 7, "id": 1 }Common mistake
Key takeaways
- 1Method, inputs, id. Every request.
- 2Same id back. Matches the reply.
- 3Any channel. HTTP, sockets or pipes.