{"id":15111154,"url":"https://github.com/resourcepool/jarpic-client","last_synced_at":"2025-10-23T04:31:09.385Z","repository":{"id":57736129,"uuid":"53656866","full_name":"resourcepool/jarpic-client","owner":"resourcepool","description":"A Simple JSON-RPC 2.0 Java Client using Jackson2 and OkHttp","archived":false,"fork":false,"pushed_at":"2017-08-05T11:58:41.000Z","size":39,"stargazers_count":6,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-30T17:23:55.540Z","etag":null,"topics":["android","client","java","json","json-rpc","json-rpc-client","json-rpc2"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/resourcepool.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-11T09:46:16.000Z","updated_at":"2023-08-24T08:29:32.000Z","dependencies_parsed_at":"2022-08-24T01:20:21.822Z","dependency_job_id":null,"html_url":"https://github.com/resourcepool/jarpic-client","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/resourcepool%2Fjarpic-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/resourcepool%2Fjarpic-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/resourcepool%2Fjarpic-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/resourcepool%2Fjarpic-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/resourcepool","download_url":"https://codeload.github.com/resourcepool/jarpic-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237780058,"owners_count":19365116,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","client","java","json","json-rpc","json-rpc-client","json-rpc2"],"created_at":"2024-09-26T00:01:53.809Z","updated_at":"2025-10-23T04:31:09.096Z","avatar_url":"https://github.com/resourcepool.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jarpic-client\nA Simple JSON-RPC 2.0 Java Client using Jackson and OkHttp\n\nThis library works on Android as well\n\nIt contains both synchronous and asynchronous APIs.\n\n[![Build Status](https://travis-ci.org/resourcepool/jarpic-client.svg?branch=master)](https://travis-ci.org/resourcepool/jarpic-client)\n\n## Add it to your project\nMaven:\n```xml\n\u003c!-- https://mvnrepository.com/artifact/io.resourcepool/jarpic-client --\u003e\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.resourcepool\u003c/groupId\u003e\n    \u003cartifactId\u003ejarpic-client\u003c/artifactId\u003e\n    \u003cversion\u003e1.1.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\nGradle:\n```groovy\ncompile 'io.resourcepool:jarpic-client:1.1.0'\n```\n\n## Usage\n\nSend single JSON-RPC request:\n\n```java\nJsonRpcClient client = new HttpJsonRpcClient(endpoint);\nJsonRpcRequest req = JsonRpcRequest.builder()\n  .method(\"cmd::execCmd\")\n  .param(\"param1\", \"myvalue1\")\n  .param(\"param2\", \"myvalue2\")\n  .build();\n  \n// With your own Result class POJO  \nJsonRpcResponse\u003cResult\u003e res = client.send(req, Result.class);\nSystem.out.println(\"Response is:\");\nSystem.out.println(res);\n```\n\nSend multiple JSON-RPC requests:\n\n```java\nJsonRpcClient client = new HttpJsonRpcClient(endpoint);\nJsonRpcRequest req1 = JsonRpcRequest.builder()\n  .method(\"cmd::execCmd\")\n  .param(\"param1\", \"myvalue1\")\n  .param(\"param2\", \"myvalue2\")\n  .build();\n\nJsonRpcRequest req2 = JsonRpcRequest.builder()\n  .method(\"cmd::resumeCmd\")\n  .param(\"key\", \"value\")\n  .build();\n  \nList\u003cJsonRpcRequest\u003e reqs = JsonRpcRequest.combine(req1, req2);\n  \n// With your own Result class POJO  \nList\u003cJsonRpcResponse\u003cResult\u003e\u003e res = client.send(reqs, Result.class);\nSystem.out.println(\"Response is:\");\nSystem.out.println(res);\n```\n\nSend single JSON-RPC Notification\n```java\nJsonRpcClient client = new HttpJsonRpcClient(endpoint);\nJsonRpcRequest req = JsonRpcRequest.notifBuilder()\n  .method(\"cmd::execCmd\")\n  .param(\"param1\", \"myvalue1\")\n  .param(\"param2\", \"myvalue2\")\n  .build();\n  \n// With your own Result class POJO  \nJsonRpcResponse\u003cResult\u003e res = client.send(req, Result.class);\nSystem.out.println(\"Response is:\");\nSystem.out.println(res);\n```\n\n**All these methods can also be called asynchronously by providing an extra parameter.**\n  \nSimple Example:\n```java\nJsonRpcClient client = new HttpJsonRpcClient(endpoint);\nJsonRpcRequest req = JsonRpcRequest.builder()\n  .method(\"cmd::execCmd\")\n  .param(\"param1\", \"myvalue1\")\n  .param(\"param2\", \"myvalue2\")\n  .build();\n  \nclient.send(req, String.class, new JsonRpcCallback() {\n      @Override\n      public void onResponse(@Nullable JsonRpcResponse res) {\n        System.out.println(\"Response is:\");\n        System.out.println(res);\n      }\n\n      @Override\n      public void onFailure(IOException ex) {\n        System.err.println(\"Something bad happened: \" + ex.getMessage());\n      }\n    });\n\n```\n\nExample with custom deserializer:\n```java\nJsonRpcRequest req = JsonRpcRequest.builder()\n      .method(\"cmd::start\")\n      .param(\"apiKey\", apiKey)\n      .build();\n\nclient.send(req, Result.class, new JsonRpcCallback\u003cResult\u003e() {\n      @Override\n      public void onResponse(@Nullable JsonRpcResponse\u003cResult\u003e res) {\n        // With your own Result class POJO  \n        System.out.println(res.getResult());\n      }\n\n      @Override\n      public void onFailure(IOException ex) {\n        System.err.println(\"Something bad happened: \" + ex.getMessage());\n      }\n    });\n```\n\n## License\n   Copyright 2017 Resourcepool\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fresourcepool%2Fjarpic-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fresourcepool%2Fjarpic-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fresourcepool%2Fjarpic-client/lists"}