java - Retrofit and GRPC -


been tackling 2 days. i'm trying use protoconverterfactory grpc not having luck it.

public class retrofitservice {     public void makerequest() {          retrofit retrofit = new retrofit.builder()                 .baseurl("https://myurl:444")                 .addconverterfactory(protoconverterfactory.create())                 .build();          retrofitserviceimp serviceimp = retrofit.create(retrofitserviceimp.class);         serviceimp.gettoken(empty.getdefaultinstance()).enqueue(new callback<token.tokenresponse>() {             @override             public void onresponse(call<token.tokenresponse> call, response<token.tokenresponse> response) {                 log.d("success", "onresponse: ");             }              @override             public void onfailure(call<token.tokenresponse> call, throwable t) {                 log.d("error", "onfailure: " + t.getlocalizedmessage() + t.getmessage());             }         });     }      interface retrofitserviceimp {          @post("/")         call<token.tokenresponse> gettoken(@body empty empty);      } } 

there no examples of how correctly tried following unit tests in converter factory.

https://github.com/square/retrofit/blob/master/retrofit-converters/protobuf/src/test/java/retrofit2/converter/protobuf/protoconverterfactorytest.java

how link compiled grpc code converter or retrofit lib?


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -