Challenge 2: Write a JSON-RPC Request/Response Pair — Possible Solution ==================================================================== // Request { "jsonrpc": "2.0", "method": "add", "params": [7, 5], "id": 42 } // Response { "jsonrpc": "2.0", "result": 12, "id": 42 } WHY THIS WORKS AS AN ANSWER ------------------------------ Every part of the JSON-RPC 2.0 spec shown in the chapter is present and used correctly: - "jsonrpc": "2.0" appears in both the request and response, declaring which version of the spec is being followed. - "method": "add" names the procedure being called. - "params": [7, 5] supplies the two numbers as an ordered list of arguments, matching how the chapter's "subtract" example passed its two numbers. - "id": 42 appears in BOTH the request and the response with the SAME value — this is the detail the challenge specifically called out, and it's what lets a client match this particular response back to this particular request, especially important if several requests were sent before their responses come back (which is exactly why the spec requires it rather than treating it as optional). - "result": 12 is the actual answer (7 + 5), replacing "params" in the response the same way the chapter's example replaced it with "result": 19 for the subtraction call.