Challenge 1: Convert REST to RPC — Possible Solution ==================================================================== { "jsonrpc": "2.0", "method": "getUser", "params": [42], "id": 1 } WHY THIS WORKS AS AN ANSWER ------------------------------ The REST call GET /users/42 communicates two things: WHICH resource (a user) and WHICH specific one (id 42), with the HTTP method (GET) implicitly meaning "retrieve." The JSON-RPC equivalent has to fold all of that into the method-call shape instead: - The "action + resource" idea (retrieve a user) becomes the METHOD NAME itself: "getUser" — notice the verb ("get") is now baked into the name, exactly the opposite of REST's convention from Chapter 3, where verbs belong in the HTTP method, not the URL. - The specific id (42) becomes a PARAMETER passed in "params", rather than being part of a URL path. - There's no separate HTTP method distinguishing this from any other kind of call — JSON-RPC requests are typically all sent the same way (often POST to one single endpoint), with "method" doing all the work of saying what's actually being requested. This is the core structural shift this chapter is testing: moving from "a noun in the URL plus a verb in the HTTP method" to "a single named call carrying both the action and its target together."