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

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.

主站蜘蛛池模板: 淮阳县| 沭阳县| 德阳市| 启东市| 神农架林区| 满城县| 沙湾县| 隆安县| 教育| 榆中县| 渝中区| 九台市| 香河县| 南木林县| 六枝特区| 孟州市| 沙田区| 清远市| 大兴区| 富顺县| 镇江市| 石棉县| 喀喇沁旗| 方山县| 常宁市| 霍城县| 泰顺县| 平度市| 衡阳市| 饶平县| 河东区| 拜泉县| 海阳市| 青岛市| 新余市| 延川县| 枣阳市| 松潘县| 房产| 乾安县| 满洲里市|