Laur's blog
Sign in Subscribe

response

A collection of 1 post
Intercept OkHttpClient Response for Debug
android

Intercept OkHttpClient Response for Debug

I wanted to log the data retrieved by OkHttpClient for debugging purposes. After digging for a while, the process seems quite straight-forward now. First, we create the OkHttpClient: OkHttpClient client = new OkHttpClient(); client.setFollowRedirects(false); client.setFollowSslRedirects(false); Then, we add an interceptor: client.interceptors().add((chain) -> { /** Interceptor
Mar 16, 2016 1 min read
Page 1 of 1
Laur's blog © 2025
  • Sign up
Powered by Ghost