2

I'm trying using C#. Getting the following error message:

{
    "error": {
    "code": -32700,
    "message": "Parse error"
},
"id": 0,
"jsonrpc": ""

}

Basically doing the following, which should work. Could anyone shed some light? Been looking at some examples, but can't find the issue.

var values = new NameValueCollection();
values["jsonrpc"] = "2.0";
values["id"] = "0";
values["method"] = "getbalance";
1
  • I see some info in the logs: 2016-Oct-02 18:38:05.922851 [RPC0]Failed to parse json, what: Wrong JSON charact er at: jsonrpc=2.0&id=0&method=getbalance
    – MerkelMan
    Oct 2, 2016 at 5:52

1 Answer 1

4

Here's the curl command I use:

curl -X POST http://127.0.0.1:5000/json_rpc -d '{"jsonrpc":"2.0","method":"getbalance","id":"test"}' -H "Content-Type: application/json"

Your JSON seems to be formatted entirely incorrectly, as name=value pairs, so check the library you're using to produce the JSON.

1
  • Oh yeah, thanks, I tried with that and it turns out C# was not doing what I wanted. Worked with "client.UploadData" instead of "client.UploadValues".
    – MerkelMan
    Oct 2, 2016 at 19:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.