0x80
unread,May 22, 2012, 8:30:12 AM5/22/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to BitcoinJS
Hi,
I recently started using your jsonrpc module. I am wondering if there
is a way to call methods with named parameters, and also methods
without an id like notifications.
I got these examples from the jsonrpc 2.0 specs:
rpc call with named parameters:
--> {"jsonrpc": "2.0", "method": "subtract", "params": {"subtrahend":
23, "minuend": 42}, "id": 3}
<-- {"jsonrpc": "2.0", "result": 19, "id": 3}
--> {"jsonrpc": "2.0", "method": "subtract", "params": {"minuend": 42,
"subtrahend": 23}, "id": 4}
<-- {"jsonrpc": "2.0", "result": 19, "id": 4}
a Notification:
--> {"jsonrpc": "2.0", "method": "update", "params": [1,2,3,4,5]}
--> {"jsonrpc": "2.0", "method": "foobar"}
In particular I'd like to use the named parameters. I tried passing in
an object instead of an array like this:
client.call('objectStraight', {foo:"bar", evil:666});
But this results in an error:
TypeError: Object #<Object> has no method 'join'
at Server.handleCall (/Users/thijskoerselman/Development/octo/
mediaprocessor/node_modules/jsonrpc2/src/jsonrpc.js:73:56)
at /Users/thijskoerselman/Development/octo/mediaprocessor/
node_modules/jsonrpc2/src/jsonrpc.js:431:10
at IncomingMessage.<anonymous> (/Users/thijskoerselman/Development/
octo/mediaprocessor/node_modules/jsonrpc2/src/jsonrpc.js:439:5)
at IncomingMessage.emit (events.js:64:17)
at HTTPParser.onMessageComplete (http.js:137:23)
at Socket.ondata (http.js:1410:22)
at TCP.onread (net.js:354:27)
Is it possible with the current implementation?