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";
MerkelMan
  • 21
  • 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 02 '16 at 05:52

1 Answers1

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.

Riaan Swart
  • 1,058
  • 7
  • 13
  • 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 02 '16 at 19:01