Json-RPC with Retrofit.
Java Shell
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.buildscript Add Travis Config Feb 1, 2016
.gitignore Initial Commit Jan 10, 2016
.travis.yml Add Travis Config Feb 1, 2016
README.md add download instructions Feb 1, 2016
checkstyle.xml Initial Commit Jan 10, 2016
pom.xml Merge pull request #3 from segmentio/simplify Jan 11, 2016



JSON-RPC with Retrofit.


Declare your RPC Service.

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.

Retrofit retrofit = new Retrofit.Builder()

Use Retrofit to build your service.

MultiplicationService service = retrofit.create(MultiplicationService.class);

Use your service.

service.multiply(MultiplicationArgs.create(2, 3)).execute().body(); // -> 6


Note: Only snapshot releases are available currently.

Download the latest JAR or grab via Maven:


or Gradle:

compile 'com.segment.retrofit.jsonrpc:jsonrpc:1.0.0-SNAPSHOT'