For a `HttpClient` provided by ktor - can it be us...
# ktor
q
For a
HttpClient
provided by ktor - can it be used as a singleton or should new requests made with different instances ?
We currently have a
kodein
configuration to use a singleton
bind<HttpClient>() with singleton { HttpClient(OkHttp) }
, but are also confronted with a memory leak in our app and I currently suspect the HttpClient 🤔
e
Hi @quiqua, you can create multiple clients if you want to, but you also can use single
q
Alright, then it might be a different issue within the project 🙂 Thanks for the quick heads up.
is the
HttpResponse.close
method called automatically or is it my responsibility to do so at some part of the code execution?
e
You should call
close
manually or with
response.use { }
method
q
thanks 🙂