java - Square-Retrofit Response content type was not a proto (Protobuf) -
i'm trying send post request server, i'm getting response
caused by: retrofit.converter.conversionexception: response content type not proto: application/x-protobuf;charset=utf-8
i'm not sure if i've coded wrong.
interface restinterface:
@headers({"accept: application/x-protobuf", "content-type: application/x-protobuf", "authorization: basic mtaymtg3ojewmje4nw=="}) @post("/dashboard/mobile") mobiledashboardresponse getquotagroupsbypublisher(@body mobiledashboardrequest mobiledashboardrequest);
adapter:
restadapter restadapter = new restadapter.builder() .setendpoint(baseurl) .setconverter(new protoconverter()).build();
example usage
mobiledashboardrequest mobiledashboardrequest = mobiledashboardrequest.newbuilder() .setipaddress("97.65.116.172") .setuserid(30002996) .build(); mobiledashboardresponse mobiledashboardresponse = pfsrestapi.getquotagroupbypublisher(mobiledashboardrequest); system.out.println(mobiledashboardresponse);
when send request (using testng) i'm getting response of: org.testng.internal.methodinvocationhelper.invokehookable(methodinvocationhelper.java:212)
i'm not sure i'm doing wrong it.
retrofit.retrofiterror: response content type not proto: application/json;charset=utf-8
Comments
Post a Comment