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

前端 未结 9 2089
盖世英雄少女心
盖世英雄少女心 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 22:05

    For android studio before 3.0 (using android motinor)
    https://futurestud.io/tutorials/retrofit-2-log-requests-and-responses
    https://www.youtube.com/watch?v=vazLpzE5y9M

    And for android studio from 3.0 and above (using android profiler as android monitor is replaced by android profiler)
    https://futurestud.io/tutorials/retrofit-2-analyze-network-traffic-with-android-studio-profiler

提交回复
热议问题