Search code examples
androidparse-platformokhttp

Parse.com Android SDK OKHTTP interceptor


With version 1.15 of the Parse Android SDK, the previous network interceptor model was removed in favor of OKHTTP interceptors. However, I can't find any information on how to add an interceptor. Creating an interceptor class is fine, but then what do I do with it? The Parse.Configuration.Builder class, which is where that used to be done, doesn't seem to have a method to do it.


Solution

  • There is nowhere to directly pass in an interceptor, but Parse.Configuration.Builder has a method clientBuilder. You make a OkHttpClient.Builder however you want, for example with a HttpLoggingInterceptor, and pass it to clientBuilder.