1. This is the time when I use upgrade errors
first step:
public interface RequestService { @POST ("home/indexThree") Call<RequestBody> getHomeinfo(@Body RequestBody info); }
second step:
Retrofit retrofit = new Retrofit.Builder() .baseUrl(url) .addConverterFactory(GsonConverterFactory.create()) .build(); RequestService requestService = retrofit.create(RequestService.class); RequestBody body = RequestBody.create(JSON, jsonObject.toString()); Call<RequestBody> homeinfo = requestService.getHomeinfo(body); homeinfo.enqueue(new Callback<RequestBody>() { @Override public void onResponse(Call<RequestBody> call, Response<RequestBody> response) { System.out.println("response"+response.body().toString()); } @Override public void onFailure(Call<RequestBody> call, Throwable t) { System.out.println("onFailure"+t.getMessage().toString()); } });
I have been searching online for a long time. But to no avail. Please help or try to give some ideas on how to achieve this. Thanks!
source share