先声明一下我这里使用的 Retrofit 的版本是
compile 'com.squareup.retrofit:retrofit:2.0.0-beta1' compile 'com.squareup.retrofit:converter-gson:2.0.0-beta1'其他版本不一定可以这么使用
Retrofit retrofit = new Retrofit.Builder() .baseUrl(baseUrl) .client(okHttpClient) .addConverter(String.class,new ToStringConverter()) .addConverterFactory(GsonConverterFactory.create()) .build();
这里我得自定义这个 ToStringConverter 实现 Converter类
我这里就不介绍retrofit 的基本使用方式了 网上一搜一大片