Nachrüstung druckt Protokoll nicht. Protokollebene auf ausführlich gesetzt. Versuchte HttpLoggingInterceptor auch.Android-Nachrüstprotokoll wird nicht angezeigt
diese gradles mit
compile 'com.squareup.retrofit2:retrofit:2.0.2'
compile 'com.squareup.retrofit2:converter-gson:2.0.2'
compile 'com.squareup.okhttp3:okhttp:3.2.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.3.1'
-Code
OkHttpClient httpClient = new OkHttpClient();
HttpLoggingInterceptor httpLoggingInterceptor = new HttpLoggingInterceptor();
httpLoggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
httpClient.newBuilder().connectTimeout(6, TimeUnit.MINUTES)
.readTimeout(6, TimeUnit.MINUTES)
.writeTimeout(6, TimeUnit.MINUTES)
.addInterceptor(new Interceptor() {
@Override
public Response intercept(Chain chain) throws IOException {
Request original = chain.request();
Request.Builder requestBuilder = original.newBuilder()
.header("Content-Type", "application/json")
.header("Authorization", "[email protected]#JG_a34-n3d")
.method(original.method(), original.body());
Request request = requestBuilder.build();
return chain.proceed(request);
}
})
.addInterceptor(httpLoggingInterceptor);
return httpClient;
U hinzugefügt OkHttpClient zu Retrofit? – Esperanz0
Vielleicht haben Sie eine Antwort auf Ihr Problem gefunden? – sanevys
@sanevys ja ... Ich habe eine Antwort als richtig markiert –