ExecutorCallAdapterFactory $ ExecutorCallbackCall @ 5063

时间:2019-03-01 16:16:53

标签: python django api localhost retrofit

  

响应= null   &req = null&我使用localhost时请求400错误

公共类MainActivity扩展了AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    String mob="09143612440";
    resiveWordnet(mob);
}

public void resiveWordnet(String mobile){

    Gson gson = new GsonBuilder()
            .setLenient()
            .create();

    Retrofit retrofit = new Retrofit.Builder()
            .baseUrl("http://10.0.2.2:8000/book/")
            .addConverterFactory(GsonConverterFactory.create())
            .build();

    Apiconfig apiconfig = retrofit.create(Apiconfig.class);
    Call<List<Object>> call = apiconfig.sendMobile();
    call.enqueue(new Callback<List<Object>>() {
        @Override
        public void onResponse(Call<List<Object>> call, Response<List<Object>> response) {
            List<Object> req = response.body();
            int x = 10;
        }

        @Override
        public void onFailure(Call<List<Object>> call, Throwable t) {

        }
    });
}
}
  

ApiConfig是接口       //接口       公共接口Apiconfig {       // @ FormUrlEncoded       @POST(“ wordnet / good”)       致电> sendMobile();

}

出什么问题了?请帮帮我

0 个答案:

没有答案