We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1ca496a commit 14f33ceCopy full SHA for 14f33ce
README.md
@@ -496,3 +496,20 @@ func main() {
496
// unknown fields are now allowed in the response
497
}
498
```
499
+
500
+### Change default RPCRequestID
501
502
+By default, the client will set the id of an RPCRequest to 0.
503
+This can be changed by setting the RPCClientOpts.DefaultRPCRequestID to a custom value:
504
505
+```go
506
+func main() {
507
+ rpcClient := jsonrpc.NewClientWithOpts("http://my-rpc-service:8080/rpc", &jsonrpc.RPCClientOpts{
508
+ DefaultRPCRequestID: 1,
509
+ })
510
511
+ // requests now have default id 1
512
+}
513
+```
514
515
+You may also use NewRequestWithID() to set a custom id when creating a raw request.
0 commit comments