Skip to content

Instantly share code, notes, and snippets.

@LeKovr
Created January 5, 2018 20:16
Show Gist options
  • Save LeKovr/95288db86ed485378f76f0419207128d to your computer and use it in GitHub Desktop.
Save LeKovr/95288db86ed485378f76f0419207128d to your computer and use it in GitHub Desktop.
dbrpc sample function calls

Sample function calls

GET

$ curl -gs http://localhost:8081/rpc/concat?a_arg1=prefix&a_arg2=suffix

{
  "success": true,
  "result": [
    {
      "concat": "prefixsuffix"
    }
  ]
}

POST

$ curl -gsd {"a_arg1":"prefix","a_arg2":"suffix"} http://localhost:8081/rpc/concat

[
  {
    "concat": "prefixsuffix"
  }
]

JSON-RPC

$ curl -gsd {"jsonrpc":"2.0","id":1,"method":"concat","params":{"a_arg1":"prefix","a_arg2":"suffix"}} http://localhost:8081/rpc/

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": [
    {
      "concat": "prefixsuffix"
    }
  ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment