Laur's blog
Sign in Subscribe

okhttp

A collection of 2 posts
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
Manually Create a Retrofit/OkHttp Response for Testing
android

Manually Create a Retrofit/OkHttp Response for Testing

I've got a method in an use case which requires a Retofit Response object as parameter and I need to test it. Now, I can use the Retrofit itself and build one with the network, but it would require the full android shebang. I've opted instead
Sep 21, 2015 1 min read
Page 1 of 1
Laur's blog © 2025
  • Sign up
Powered by Ghost