facebookarchive / stetho

Stetho is a debug bridge for Android applications, enabling the powerful Chrome Developer Tools and much more.
http://facebook.github.io/stetho/
MIT License
12.66k stars 1.13k forks source link

Question: Related using OkHttp network Lib / Package #582

Closed ankit-ankuagrawal closed 6 years ago

ankit-ankuagrawal commented 6 years ago

In order to intercept the network using Ok Http network Lib, we have to use addNetworkInterceptor method to set the interceptor interface.

Following is the issue, when ever doing network request creating new object and explicitly setting interceptor for each request. Facing similar problem with stetho lib also.

Is their a way that once the interceptor is set, it should not be required to set again again for request?

jasta commented 6 years ago

Interceptors are added globally when you configure OkHttpClient. You don't need to repeat this configuration once per request, just once per process start.