61 lines
1.2 KiB
HTTP
61 lines
1.2 KiB
HTTP
POST http://localhost:8000/
|
|
Content-Type: application/json
|
|
{
|
|
"jsonrpc": "2.0",
|
|
"method": "multiply",
|
|
"params": {
|
|
"a": 2,
|
|
"b": 3
|
|
},
|
|
"id": 1
|
|
}
|
|
|
|
|
|
###
|
|
POST http://localhost:8000/
|
|
Content-Type: application/json
|
|
{
|
|
"jsonrpc": "2.0",
|
|
"method": "divide",
|
|
"params": {
|
|
"a": 10,
|
|
"b": 10
|
|
},
|
|
"id": 2
|
|
}
|
|
|
|
|
|
### Batch request
|
|
POST http://localhost:8000/
|
|
Content-Type: application/json
|
|
{ "jsonrpc": "2.0", "method": "multiply", "params": { "a": 2, "b": 3 }, "id": 10 }
|
|
{"jsonrpc": "2.0", "method": "sum", "params": [1,2,4], "id": "1"}
|
|
{"jsonrpc": "2.0", "method": "notify_hello", "params": [7]}
|
|
{"jsonrpc": "2.0", "method": "subtract", "params": [42,23], "id": "2"}
|
|
{
|
|
"jsonrpc": "2.0",
|
|
"method": "divide",
|
|
"params": {
|
|
"a": 10,
|
|
"b": 3
|
|
},
|
|
"id": "divide"
|
|
}
|
|
{"foo": "boo"}
|
|
{"jsonrpc": "2.0", "method": "foo.get", "params": {"name": "myself"}, "id": "5"}
|
|
{"jsonrpc": "2.0", "method": "get_data", "id": "9"}
|
|
{
|
|
"jsonrpc": "2.0",
|
|
"method": "divide",
|
|
"params": {
|
|
"a": 10,
|
|
"b": 0
|
|
},
|
|
"id": "divide"
|
|
}
|
|
{
|
|
"jsonrpc": "2.0",
|
|
"method": "divide",
|
|
"params": {},
|
|
"id": "divide"
|
|
}
|