This commit is contained in:
Trey t
2025-11-04 15:41:03 -06:00
parent f2ade0a1e2
commit 219eaa69ee
17 changed files with 637 additions and 92 deletions

View File

@@ -1,3 +1,33 @@
package com.mycrib.shared.network
import io.ktor.client.*
import io.ktor.client.engine.darwin.*
import io.ktor.client.plugins.contentnegotiation.*
import io.ktor.client.plugins.logging.*
import io.ktor.serialization.kotlinx.json.*
import kotlinx.serialization.json.Json
actual fun getLocalhostAddress(): String = "127.0.0.1"
actual fun createHttpClient(): HttpClient {
return HttpClient(Darwin) {
install(ContentNegotiation) {
json(Json {
ignoreUnknownKeys = true
isLenient = true
prettyPrint = true
})
}
install(Logging) {
logger = Logger.DEFAULT
level = LogLevel.ALL
}
engine {
configureRequest {
setAllowsCellularAccess(true)
}
}
}
}