okhttp icon indicating copy to clipboard operation
okhttp copied to clipboard

okHttpClient.interceptors() not returning a modifiable list

Open juliomarcos opened this issue 10 years ago • 2 comments

http://square.github.io/okhttp/3.x/okhttp/okhttp3/OkHttpClient.html#interceptors-- should return a modifiable list according to documentation

Returns a modifiable list of interceptors that observe the full span of each call: from before the connection is established (if any) until after the response source is selected (either the origin server, cache, or both).

but it is returning an unmodifiable one.

I'm using version 3.0.0-RC1

juliomarcos avatar Jan 04 '16 18:01 juliomarcos

OkHttpClient is now immutable. The mutable list is available on OkHttpClient.Builder but not OkHttpClient. We'll have to update the documentation. Thanks for pointing it out.

JakeWharton avatar Jan 04 '16 18:01 JakeWharton

I've started using the builder thinking it was just another way to do it. So, that's the case. Thank you!

juliomarcos avatar Jan 04 '16 18:01 juliomarcos