I am thinking about what to use to perform network...
# multiplatform
d
I am thinking about what to use to perform network requests in KMM, given that the existing clients already have certain configurations and interceptions, and I was wondering if it makes sense having Ktor Client as layer on top of
OkHttp
and
NSUrlSession
with code like:
Copy code
// Android
public fun newHttpClient(nativeClient: OkHttpClient): HttpClient {
    return HttpClient(OkHttp){
        engine {
            preconfigured = nativeClient
        }
    }
}
// iOS
public fun newHttpClient(nativeSession: NSURLSession): HttpClient {
    return HttpClient(Darwin) {
        engine {
            configureSession { // how to do the same as Android?
            }
        }
    }
}
I was wondering if someone uses this approach, and how does he/she configures the iOS
HttpClient
2
k
were you able to configure it?
d
no, I ended up using
expect
/
actual
for the networking with two implementations for now