太长不看版
retrofit 可以得到String字符串的,使用JsonObject;
public interface APIService {
@FormUrlEncoded
@POST("tqt-system/code/phone")
Call<JsonObject> postPhoneCode(@Field("phone") String phone);
@FormUrlEncoded
@POST("/tqt-system/login")
Call<ResponseBody> postLogin(@Field("phone") String phone, @Field("code") String code, @Header("token") String token);
}
要注意区分 JsonObject 和 JSONObject!
也有说JsonConverterFactory 代替 GsonConverterFactory
JsonConverterFactory github地址: https://github.com/brokge/Retrofit2.0-JSONCoverter