Is there a good way to implement a “blocking” interceptor request?
The basic idea is that all requests should be intercepted and additional headers added token.
If tokenit does not already exist, it must first be extracted, then added to this request and cached for future use. tokenretrieved through an API call.
I tried to execute a synchronous request, but it creates android.os.NetworkOnMainThreadException. And the implementation with flags in_progressdoes not look very good.
source
share