xxfast
09/20/2024, 1:10 AMHttpClient(Android)
with a custom URLConnection
?
val urlConnection: URLConnection = network.openConnection(URL(connection.serverUri))
urlConnection.connect()
val client = HttpClient(Android){
// configure the client to use the url connection from the network
}
Aleksei Tirman [JB]
09/20/2024, 8:12 AMHttpURLConnection
created by Ktor using the requestConfig configuration method.xxfast
09/25/2024, 10:15 PMpublic class AndroidEngineConfig : HttpClientEngineConfig() {
/**
* Allows you to configure [HTTPS](<https://ktor.io/docs/client-ssl.html>) settings for this engine.
*/
public var sslManager: (HttpsURLConnection) -> Unit = {}
/**
* Allows you to set engine-specific request configuration.
*/
public var requestConfig: HttpURLConnection.() -> Unit = {}
}
Are we just supposed to do this?
HttpClient(Android) {
engine {
requestConfig(urlConnection)
sslManager(urlConnection)
}
}