You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 1, 2023. It is now read-only.
OkHttp's interceptors require OkHttp 2.2 or better. Unfortunately, interceptors do not work with OkUrlFactory, or the libraries that build on it, including Retrofit ≤ 1.8 and Picasso ≤ 2.4.
publicclassOkHttpStackextendsHurlStack {
privatefinalOkUrlFactoryokUrlFactory;
publicOkHttpStack() {
this(newOkUrlFactory(newOkHttpClient()));
}
publicOkHttpStack(OkUrlFactoryokUrlFactory) {
if (okUrlFactory == null) {
thrownewNullPointerException("Client must not be null.");
}
this.okUrlFactory = okUrlFactory;
}
@OverrideprotectedHttpURLConnectioncreateConnection(URLurl) throwsIOException {
returnokUrlFactory.open(url);
}
}
The text was updated successfully, but these errors were encountered:
Volley can be supported a few different ways. There's discussion of a generic solution in #51, but the currently preferred solution for okhttp specifically is with a new OkHttpStack implementation: https://gist.github.com/bryanstern/4e8f1cb5a8e14c202750.
I use the volley +okhttp. Implement Android Volley with OkHttp 2.2 using OkUrlFactory .
but from the https://github.com/square/okhttp/wiki/Interceptors ,at last ,it'said
Availability
OkHttp's interceptors require OkHttp 2.2 or better. Unfortunately, interceptors do not work with OkUrlFactory, or the libraries that build on it, including Retrofit ≤ 1.8 and Picasso ≤ 2.4.
The text was updated successfully, but these errors were encountered: