Skip to content

Test: Request & Response

Roman Shamyan edited this page Mar 4, 2014 · 6 revisions
Basic test cases (under development)
Type HEADERS BODY RESPONSE
Normal Authorization: Basic YWRtaW46c2VjcmV0 {"jsonrpc": "2.0", "method": "subtract", "params": [42, 23], "id": 1} {"jsonrpc": "2.0", "result": 19, "id": 1}
Notification {"jsonrpc": "2.0", "method": "multiply", "params":[42, 23]} {"jsonrpc": "2.0", "result": 966, "id": null}
Parse error {"jsonrpc": "2.0", "method": "foobar, "params": "bar", "baz] {"jsonrpc": "2.0", "error": {"code": -32700, "message": "Parse error"}, "id": null}
Method not found {"jsonrpc": "2.0", "method": "foobar", "id": "1"} {"jsonrpc": "2.0", "error": {"code": -32601, "message": "Method not found"}, "id": "1"}
Invalid Request {"jsonrpc": "2.0", "method": 1, "params": "bar"} {"jsonrpc": "2.0", "error": {"code": -32600, "message": "Invalid Request"}, "id": null}
Ivalid Params {"jsonrpc": "2.0", "method": "subtract", "params": ["sunday"]} {"jsonrpc": "2.0", "error": {"code": -32602, "message": "Invalid Params"}, "id": null}
Server error {"jsonrpc": "2.0", "method": "divide", "params": [4,2]} {"jsonrpc": "2.0", "error": {"code": -32000, "message": "Authorization required"}, "id": null}
Clone this wiki locally