Skip to content

Commit

Permalink
[json-rpc] adding example for batching requests
Browse files Browse the repository at this point in the history
  • Loading branch information
mimoo authored and bors-libra committed Dec 22, 2020
1 parent 7b756d6 commit 1fcf5b8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions json-rpc/json-rpc-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ You can use this information to verify liveness / status of nodes in the network

The JSON-RPC protocol allows requests to be batched. An arbitrary number of requests (maximum 20 by default) can be combined into a single batch and submitted to the server. These requests will be processed together under a single request context.

For example:

```
curl -X POST -H "Content-Type: application/json" --data '[{"jsonrpc":"2.0","method":"get_metadata","params":[1],"id":1},{"jsonrpc":"2.0","method":"get_metadata","params":[9],"id":2}]' "https://client.testnet.diem.com/"
```
### Errors

If errors occur during a request, they are returned in an error object, as defined in: [https://www.jsonrpc.org/specification#error_object](https://www.jsonrpc.org/specification#error_object).
Expand Down

0 comments on commit 1fcf5b8

Please sign in to comment.