官术网_书友最值得收藏!

JSON-RPC

JSON-RPC is an attempt at a standard way of representing objects for RPC using JSON. This removes the need to decode any proprietary binary protocol at the expense of transfer speed. There is no requirement for any particular client or server to serve this data format, TCP sockets, and the ability to write strings that pretty much most all programming languages can manage are all you require.

Unlike Thrift and Protocol Buffers, JSON-RPC sets the standard for the message serialization.

JSON-RPC implements some nice features that allow the batching of requests; every request contains an id parameter, which is established by the client. When the server responds it will return the same identifier allowing the client to understand to which request a response relates.

This is a JSON-RPC serialized request:

{
"jsonrpc": "2.0",
"method": "Users.v1.CreateUser",
"params": {
"name": "Nic Jackson",
"id": 12335432434
},
"id": 1
}

This is a JSON-RPC serialized response:

{
"jsonrpc": "2.0",
"result": {...},
"id": 1
}

Find more information on JSON-RPC 2.0 at http://www.jsonrpc.org/specification.

主站蜘蛛池模板: 朝阳区| 三穗县| 云南省| 连平县| 平昌县| 江油市| 新密市| 龙川县| 太仆寺旗| 左云县| 汉阴县| 同江市| 蓝田县| 咸丰县| 龙江县| 环江| 小金县| 兴化市| 咸宁市| 岳普湖县| 盐山县| 海口市| 周口市| 钟祥市| 正阳县| 吐鲁番市| 白玉县| 盐城市| 扶绥县| 维西| 元朗区| 镇原县| 富宁县| 融水| 霍城县| 巴青县| 五指山市| 阳山县| 耒阳市| 上高县| 武夷山市|