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

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.

主站蜘蛛池模板: 米易县| 安多县| 钦州市| 永寿县| 岗巴县| 兴宁市| 汕尾市| 南和县| 华容县| 珠海市| 浑源县| 华阴市| 惠安县| 阿荣旗| 望谟县| 奉新县| 新宾| 武隆县| 鄂尔多斯市| 米泉市| 克东县| 永仁县| 西乌珠穆沁旗| 连平县| 申扎县| 呼伦贝尔市| 浦江县| 云安县| 长丰县| 宁陵县| 营山县| 孝感市| 黔江区| 五峰| 西藏| 晋城| 安新县| 长治市| 井陉县| 和林格尔县| 锡林郭勒盟|