2

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();
    }
NamNH
  • 1,752
  • 1
  • 15
  • 37
  • have look on this https://stackoverflow.com/questions/35722617/retrofit-post-using-firebase , and also see `Retrofit + Firebase` inside this link (detail about retrofit ) – sushildlh Dec 01 '16 at 08:40
  • what are you trying to do? Is it for check download progress? – franklinexpress Dec 01 '16 at 08:44
  • Post your code how you making the call right now? – android_griezmann Dec 01 '16 at 09:09
  • @sushildlh: No, this link not related to my question. franklinexpress: No I just want to counting the fullsize of reponse to comparing with other platform (iOS, winphone). android_griezmann: updated. – NamNH Dec 01 '16 at 09:12

0 Answers0