aboutsummaryrefslogtreecommitdiff
path: root/example/test.http
blob: 9e71f9efd42178e0c16c7e31c7e0fa9d3cbd6ff7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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"
  }