Logging with Retrofit 2

前端 未结 21 1605
春和景丽
春和景丽 2020-11-22 07:33

I\'m trying to get the exact JSON that is being sent in the request. Here is my code:

OkHttpClient client = new OkHt         


        
21条回答
  •  不知归路
    2020-11-22 08:06

    You can also add Facebook's Stetho and look at the network traces in Chrome: http://facebook.github.io/stetho/

    final OkHttpClient.Builder builder = new OkHttpClient.Builder();
    if (BuildConfig.DEBUG) {
        builder.networkInterceptors().add(new StethoInterceptor());
    }
    

    Then open "chrome://inspect" in Chrome...

提交回复
热议问题