How to log request and response body with Retrofit-Android?

前端 未结 9 2062
盖世英雄少女心
盖世英雄少女心 2020-11-28 21:35

I can\'t find relevant methods in the Retrofit API for logging complete request/response bodies. I was expecting some help in the Profiler (but it only offers meta-data abou

9条回答
  •  感情败类
    2020-11-28 21:48

    I used setLogLevel(LogLevel.FULL).setLog(new AndroidLog("YOUR_LOG_TAG")), it helped me.
    UPDATE.
    You can also try for debug purpose use retrofit.client.Response as response model

提交回复
热议问题