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.
how link compiled grpc code converter or retrofit lib?
Comments
Post a Comment