怪我咯2017-04-17 17:45:03
This is how I get the String directly
Get retrofit instance
public static Retrofit GetStringRetrofit(){
Retrofit retrofit = new Retrofit.Builder()
.client(okHttpClientWithBaiduHeader)
.baseUrl(AppConfig.HEFENG_BASE_URL)
.addCallAdapterFactory(RxJavaCallAdapterFactory.create())
.addConverterFactory(ScalarsConverterFactory.create()) //这里不是GsonConvertFactory了
.build();
return retrofit;
}
The interface can receive String directly
public interface GetHeWeather {
@GET("weather")
Observable<String> getHeWeather(@Query("city") String city, @Query("key") String key);
}
The following is the log
If it doesn’t work, just use subString. . .