Retrofit显示下载的内容

        HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
        interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
        OkHttpClient client = new OkHttpClient.Builder()
                .addInterceptor(interceptor)
                .retryOnConnectionFailure(true)
                .connectTimeout(15, TimeUnit.SECONDS)
                .build();


        Retrofit retrofit = new Retrofit.Builder().baseUrl(api_url).client(client).addConverterFactory(GsonConverterFactory.create()).build();
                RetrofitService service = retrofit.create(RetrofitService.class);

        Call<ApiGetMapFarms> getMapFarms = service.getMapFarms(api_token, farm_group_id);
        getMapFarms.enqueue(new Callback<ApiGetMapFarms>() {

注:要是解析的化要一行一行的解析,要是一次性拷贝解析的化则会因为空格问题解析不成

上一篇:学员捷报|青山资本独家领投,哇力机器人获数千万Pre-A融资


下一篇:写了一套优雅接口之后,领导让我给大家讲讲这背后的技术原理