KO
|
EN
gitlite — search
Search
#typescript
#ai-agents
#ai
#dsh-plugin
#deepseek-harness
#open-source
#claude-code
#codex
#cli
#developer-tools
#react
#windows
retrofit-jsonrpc
★ 56
Open GitHub ↗
Json-RPC with Retrofit.
Download README (.md)
Explore Similar Repositories
api-starter-kit
:
No description available.
abelana
:
Abelana is a simple and beautiful cross-platform application allowing users to publish and view photos.
Smart-Polyfill
:
A smart polyfill server for browsers written in Node
drum-machine
:
How to write a simple drum machine that runs in the browser
cody1991.github.io
:
个人博客(也是自己构建的一个简单Jekyll开源主题模板)
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
retrofit-jsonrpc
?
Download (.md)
# retrofit-jsonrpc JSON-RPC with Retrofit. # Usage Declare your RPC Service. ```java interface MultiplicationService { @JsonRPC("Arith.Multiply") @POST("/rpc") Call<Integer> multiply(@Body MultiplicationArgs args); } ``` Register the `JsonRPCConverterFactory` while building your `Retrofit` instance. This must be done before any other converters are applied. ```java Retrofit retrofit = new Retrofit.Builder() .baseUrl("http://localhost:1234") .addConverterFactory(JsonRPCConverterFactory.create()) .addConverterFactory(MoshiConverterFactory.create()) .build(); ``` Use Retrofit to build your service. ```java MultiplicationService service = retrofit.create(MultiplicationService.class); ``` Use your service. ```java service.multiply(MultiplicationArgs.create(2, 3)).execute().body(); // -> 6 ``` # Download *Note*: Only snapshot releases are available currently. Download [the latest JAR](https://oss.sonatype.org/content/repositories/snapshots/com/segment/retrofit/jsonrpc/jsonrpc/) or grab via Maven: ```xml <dependency> <groupId>com.segment.retrofit.jsonrpc</groupId> <artifactId>jsonrpc</artifactId> <version>1.0.0-SNAPSHOT</version> </dependency> ``` or Gradle: ```groovy compile 'com.segment.retrofit.jsonrpc:jsonrpc:1.0.0-SNAPSHOT' ```