1.method fields: Name of the interface to be accessed (users need to “log in” to access interfaces with “private” in their names)
2.params fields: Request parameter body;
3.id fields: Request count, and the server will return a same id.
// request message
{
"id" : 1,
"jsonrpc" : 2.0,
"method" : "public/hi",
"params" : {
...
}
}
// successful response message without data
{
"id" : 1,
"jsonrpc" : 2.0,
"method" : "public/hi",
"result" : "ok",
}
// successful response message with data
{
"id" : 1,
"jsonrpc" : 2.0,
"method" : "public/hello",
"result" : {
...
}
}
//unsuccessful response message
{
"jsonrpc" : 2.0,
"method" : "public/hello",
"code" : 10001,
"msg":"xxxxxx",
"id" : 1
}