Retrofit retrofit = new Retrofit.Builder()
.baseUrl("https://yuecun.yuecunpaimai.com")
.addConverterFactory(GsonConverterFactory.create())
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.build();
Api api = retrofit.create(Api.class);
Call<JsonObject> call = api.homeBanner();
call.enqueue(new Callback<JsonObject>() {
@Override
public void onResponse(Call<JsonObject> call, Response<JsonObject> response) {
System.out.println("===="+response.body());
}
@Override
public void onFailure(Call<JsonObject> call, Throwable t) {
System.out.println("===="+t.getMessage());
}
});
网友评论