简体   繁体   English

通过HTTP进行JSON RPC v2

[英]Go JSON RPC v2 over HTTP

In the Go world is there any project implements the JSON RPC 2.0 (HTTP), especially the feature of batched query? 在Go世界中,是否有任何项目实现JSON RPC 2.0(HTTP),尤其是批处理查询的功能?

Some background that is, I know there's a Go built-in one but it's not over HTTP, and Gorilla looks to supports V2 (in the v2 folder, however I can't find documentation with it), but as I tested it response empty result for a combined request like "[{valid_request...},{valid_request...}]". 有一些背景,即我知道有一个内置的Go语言,但它不是通过HTTP生成的,而Gorilla似乎支持V2(在v2文件夹中,但是我找不到它的文档),但是当我对其进行测试时,响应为空合并请求的结果,例如“ [{valid_request ...},{valid_request ...}]”。 Maybe it hasn't implemented the batched one. 也许它还没有实现批量生产。 (Have I missed anything to get it right?) (我错过了任何正确的方法吗?)

Since I can't find a ready Go server support for JsonRpc 2.0 for now, I modified the gorilla JsonRPC 2.0 to support the batched query. 由于我现在无法找到对JsonRpc 2.0的现成的Go服务器支持,因此我修改了大猩猩JsonRPC 2.0以支持批处理查询。 The forked repo is at https://github.com/jason-xxl/rpc . 分叉的仓库位于https://github.com/jason-xxl/rpc Just need to change the import path from "gorilla/rpc/v2" to "jason-xxl/rpc/v2_batch" to get a testable batched query enabled server. 只需将导入路径从“ gorilla / rpc / v2”更改为“ jason-xxl / rpc / v2_batch”即可获得可测试的批处理启用查询的服务器。 (Please let me know if I missed any one that already support 2.0 batch.) (请让我知道是否错过了已经支持2.0批处理的任何程序。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM