ericflo/node-jsonrpc — Issue #4: A couple of issues I noticed
Author: bellostom
Created: 2011-12-15 08:52:50+00:00
State: open

Hi

Just wanted to mention some issues I noticed

1) You should add the Content-Type: application/json to the headers you send

2) When you decode the server's response and you check for the result key in the object, you then call

callback(null, decoded.result);

but if you find the error key you invoke the callback as

callback(decoded.error);

Why would you send the null?

Why not just use

callback(response)

Other than these, great work