- Building Microservices with Go
- Nic Jackson
- 169字
- 2021-07-15 17:28:15
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.
- SQL Server 從入門到項目實踐(超值版)
- 構建移動網站與APP:HTML 5移動開發入門與實戰(跨平臺移動開發叢書)
- Ext JS Data-driven Application Design
- Mastering Entity Framework
- jQuery從入門到精通 (軟件開發視頻大講堂)
- Linux網絡程序設計:基于龍芯平臺
- Android底層接口與驅動開發技術詳解
- 可解釋機器學習:模型、方法與實踐
- PySpark Cookbook
- 代替VBA!用Python輕松實現Excel編程
- C語言程序設計實踐
- Applied Deep Learning with Python
- 程序員必會的40種算法
- Koa與Node.js開發實戰
- RESTful Web API Design with Node.js