Retrofit2 (Retrofit 2.1.0)와 Gson에서 json을 얻으려고합니다. 그러나 응답 체에는 없습니다. onFailure에 없습니다. Pls 도와주세요.
gradle에 이것을 추가하십시오.
compile 'com.squareup.okhttp3:logging-interceptor:3.2.0'
개조
HttpLoggingInterceptor logger = new HttpLoggingInterceptor();
logger.setLevel(HttpLoggingInterceptor.Level.BODY);
OkHttpClient client = new OkHttpClient.Builder()
.addInterceptor(logger)
.build();
retrofit = new Retrofit.Builder()
.baseUrl(RETROFIT_BASE_URL)
.addConverterFactory(GsonConverterFactory.create())
.client(client)
.build();
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다