0

The title is a bit messy, but what I'm trying to do is create a JSON RPC request which looks like this:

{
    "method":"site/method",
    "id":1,
    "filter":{
        "name":"person"
    }
}

I'm having trouble finding a way to do that. I'm using the JSONRPCBase library right now but I'm not sure it's compatible with that. Anybody have any suggestions?

SlashThingy
  • 177
  • 2
  • 12

1 Answers1

0

Your request structure is not JSON-RPC compliant.

For JSON-RPC 2.0, try:

{
  "jsonrpc":"2.0"
  "method": "site/method",
  "id": 1,
  "params": {
    "filter": {
      "name": "person"
    }
  }
}

For JSON-RPC 1.0, the parameters must to be an array, depending on your method arguments, so it can vary depending on your implementation. For example:

{
  "method": "site/method",
  "id": 1,
  "params": [{
    "filter": {
      "name": "person"
    }}]
  }
}

or

{
  "method": "site/method",
  "id": 1,
  "params": [{
      "name": "person"
    }]
  }
}
idelvall
  • 1,536
  • 15
  • 25