okhttp3
-
[Android] Http 통신을 로그로 기록하기Mobile Engineering 2020. 4. 18. 13:22
How to logging Http communication used by Okhttp? 모바일 프로그래밍을 하다 보면 인증, 로깅등을 위해서 Http 정보를 로그로 출력해야 하는 상황이 있다. Retrofit과 OkHttp를 이용해서 Http 통신에 대한 로그도 출력해보자. Retrofit, OkHttp에 대한 소개와 사용법은 이미 알고 있다고 가정한다. 1. app:gradle.build에 아래와 같이 OkHttp Logging Lib를 추가한다. ... dependencies { ... // OkHttp implementation group: 'com.squareup.okhttp3', name: 'okhttp', version: '4.5.0' // Use for HttpLoggingIntercept..