diff --git a/STNetwork/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/network/requests/UploadRequest.kt b/STNetwork/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/network/requests/UploadRequest.kt index d378ac12..9a7c0c41 100644 --- a/STNetwork/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/network/requests/UploadRequest.kt +++ b/STNetwork/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/network/requests/UploadRequest.kt @@ -31,6 +31,8 @@ import io.ktor.client.HttpClient import io.ktor.client.plugins.onUpload import io.ktor.client.request.post import io.ktor.client.request.setBody +import io.ktor.http.ContentType +import io.ktor.http.contentType import io.ktor.http.isSuccess import kotlinx.serialization.json.Json import kotlinx.serialization.json.JsonObject @@ -47,6 +49,7 @@ internal class UploadRequest(json: Json, httpClient: HttpClient) : BaseRequest(j suspend fun resendEmailCode(resendEmailCodeBody: ResendEmailCodeBody): Boolean { val httpResponse = httpClient.post(url = createUrl(ApiRoutes.resendEmailCode)) { + contentType(ContentType.Application.Json) setBody(resendEmailCodeBody) } return httpResponse.status.isSuccess() @@ -77,6 +80,7 @@ internal class UploadRequest(json: Json, httpClient: HttpClient) : BaseRequest(j suspend fun cancelUpload(jsonBody: JsonObject): Boolean { val httpResponse = httpClient.post(url = createUrl(ApiRoutes.cancelUpload)) { + contentType(ContentType.Application.Json) setBody(jsonBody) } return httpResponse.status.isSuccess()