Skip to content

Commit

Permalink
fix(#79-support-search): add default request for content type
Browse files Browse the repository at this point in the history
  • Loading branch information
y9Kap committed Oct 30, 2023
1 parent 71c08f8 commit b8482c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit b8482c0

Please sign in to comment.