我正在尝试找到一种编写Java应用程序与json-rpc服务(该服务是一个Python Twisted服务器)进行通信的方法。
然而,我还没有找到一个好的库并有一些好的例子(我已经谷歌搜索和试了大约6个小时了)。
那么,在Java中是否有任何库可用于这个,或者是否有更繁琐的低级方法。
PostMethod post = new PostMethod("http://myservice.com");
// add the payload to the post object
HttpClient client = new HttpClient();
int status = client.executeMethod(post);
String response = post.getResponseBodyAsString();
看看这个:https://code.google.com/p/json-rpc-client/
上面是一个Java中的JSON RPC客户端,可以与JSON RPC服务进行通信。