My first time using Retrofit2
and okhttp3
to send http request
. I research many sites and APIs but there a no result about "how to get fullsize of request
and reponse
". I'm using HttpLoggingInterceptor
to log the response
, but it just shows the size of body
, not the fullsize of response
(headers
, body
...). Is there a API or library to get it?
private OkHttpClient buildHttpClient(Interceptor interceptor) {
ArrayList<Protocol> protocols = new ArrayList<>();
protocols.add(Protocol.HTTP_1_1);
OkHttpClient.Builder builder = new OkHttpClient.Builder();
return builder.connectTimeout(mConnectTimeoutMs, TimeUnit.MILLISECONDS)
.readTimeout(mSocketTimeoutMs, TimeUnit.MILLISECONDS)
.protocols(protocols)
.addInterceptor(new HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY))
.addInterceptor(buildCurlInterceptor())
.build();
}