diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/KtorMeetacyEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/KtorMeetacyEngine.kt index f4073332..3caa46ec 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/KtorMeetacyEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/KtorMeetacyEngine.kt @@ -23,6 +23,8 @@ import io.ktor.client.* import io.ktor.client.call.* import io.ktor.client.plugins.* import io.ktor.client.plugins.websocket.* +import io.ktor.client.request.* +import io.ktor.http.* import io.ktor.utils.io.errors.* import io.rsocket.kotlin.ktor.client.RSocketSupport import kotlinx.coroutines.CancellationException @@ -43,6 +45,9 @@ public class KtorMeetacyEngine( install(WebSockets) install(RSocketSupport) + defaultRequest { + header(HttpHeaders.ContentType, ContentType.Application.Json.contentType) + } } private val auth = AuthEngine(baseUrl, this.httpClient) diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt index e24ce0cb..08b00a3e 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/users/UsersEngine.kt @@ -7,7 +7,6 @@ import app.meetacy.sdk.engine.requests.EditUserRequest import app.meetacy.sdk.engine.requests.GetMeRequest import app.meetacy.sdk.engine.requests.GetUserRequest import app.meetacy.sdk.engine.requests.UsernameAvailableRequest -import app.meetacy.sdk.types.annotation.UnsafeConstructor import app.meetacy.sdk.types.optional.map import app.meetacy.sdk.types.serializable.file.FileIdSerializable import app.meetacy.sdk.types.serializable.file.serializable @@ -88,7 +87,6 @@ internal class UsersEngine( ) - @OptIn(UnsafeConstructor::class) suspend fun usernameAvailable(request: UsernameAvailableRequest): UsernameAvailableRequest.Response { val url = baseUrl / "username" / "available" val body = request.toBody()