In my app I use Okhttp, and have 2 different types...
# ktor
u
In my app I use Okhttp, and have 2 different types of authentication, so I have 2 okhttp instances (per type of auth), -- and there are some interceptors shared (adding some default headers) However the way to get this common behavor shared, I use
baseOkHttpClient.newBuilder()
to get a shallow copy (so the interceptors, threadpools etc are shared) Is there a way to do this with ktor client? (to get a hierarchy of clients?)
a
You can create copies of an
HttpClient
and
HttpClientEngineFactory
with an additional configuration by using the methods described in https://stackoverflow.com/a/75590647/13963150.