Skip to content

Commit 0ead71d

Browse files
committed
doc: update and link for JSON-RPC 2.0
1 parent 1040a1f commit 0ead71d

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

doc/JSON-RPC-interface.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ requests when multiple wallets are in use.
3333

3434
```sh
3535
# Get block count from the / endpoint when rpcuser=alice and rpcport=38332
36-
$ curl --user alice --data-binary '{"jsonrpc": "1.0", "id": "0", "method": "getblockcount", "params": []}' -H 'content-type: application/json;' localhost:38332/
36+
$ curl --user alice --data-binary '{"jsonrpc": "2.0", "id": "0", "method": "getblockcount", "params": []}' -H 'content-type: application/json;' localhost:38332/
3737

3838
# Get balance from the /wallet/walletname endpoint when rpcuser=alice, rpcport=38332 and rpcwallet=desc-wallet
39-
$ curl --user alice --data-binary '{"jsonrpc": "1.0", "id": "0", "method": "getbalance", "params": []}' -H 'content-type: application/json;' localhost:38332/wallet/desc-wallet
39+
$ curl --user alice --data-binary '{"jsonrpc": "2.0", "id": "0", "method": "getbalance", "params": []}' -H 'content-type: application/json;' localhost:38332/wallet/desc-wallet
4040

4141
```
4242

@@ -80,15 +80,15 @@ The server recognizes [JSON-RPC v2.0](https://www.jsonrpc.org/specification) req
8080
and responds accordingly. A 2.0 request is identified by the presence of
8181
`"jsonrpc": "2.0"` in the request body. If that key + value is not present in a request,
8282
the legacy JSON-RPC v1.1 protocol is followed instead, which was the only available
83-
protocol in previous releases.
83+
protocol in v27.0 and prior releases.
8484

8585
|| 1.1 | 2.0 |
8686
|-|-|-|
8787
| Request marker | `"version": "1.1"` (or none) | `"jsonrpc": "2.0"` |
8888
| Response marker | (none) | `"jsonrpc": "2.0"` |
8989
| `"error"` and `"result"` fields in response | both present | only one is present |
9090
| HTTP codes in response | `200` unless there is any kind of RPC error (invalid parameters, method not found, etc) | Always `200` unless there is an actual HTTP server error (request parsing error, endpoint not found, etc) |
91-
| Notifications: requests that get no reply | (not supported) | Supported for requests that exclude the "id" field |
91+
| Notifications: requests that get no reply | (not supported) | Supported for requests that exclude the "id" field. Returns HTTP status `204` "No Content" |
9292

9393
## Security
9494

doc/release-notes-27101.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,5 @@ JSON-RPC
22
--------
33

44
The JSON-RPC server now recognizes JSON-RPC 2.0 requests and responds with
5-
strict adherence to the specification (https://www.jsonrpc.org/specification):
6-
7-
- Returning HTTP "204 No Content" responses to JSON-RPC 2.0 notifications instead of full responses.
8-
- Returning HTTP "200 OK" responses in all other cases, rather than 404 responses for unknown methods, 500 responses for invalid parameters, etc.
9-
- Returning either "result" fields or "error" fields in JSON-RPC responses, rather than returning both fields with one field set to null.
5+
strict adherence to the [specification](https://www.jsonrpc.org/specification).
6+
See [JSON-RPC-interface.md](/doc/JSON-RPC-interface.md#json-rpc-11-vs-20) for details.

0 commit comments

Comments
 (0)