Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ import createHttpClient
import io.ktor.client.HttpClient
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.coroutines.Deferred
import kotlinx.coroutines.ExperimentalCoroutinesApi
Expand Down Expand Up @@ -136,6 +138,7 @@ abstract class AbstractDeviceInfoUpdateWorker(

val url = ApiRoutesCore.sendDeviceInfo()
val response = httpClient.post(url) {
contentType(ContentType.Application.Json)
setBody(deviceInfo)
}
if (response.status.isSuccess()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ import createHttpClient
import io.ktor.client.request.post
import io.ktor.client.request.setBody
import io.ktor.client.statement.HttpResponse
import io.ktor.http.ContentType
import io.ktor.http.contentType
import io.ktor.http.isSuccess
import kotlinx.coroutines.async
import kotlinx.coroutines.awaitAll
Expand Down Expand Up @@ -94,6 +96,7 @@ abstract class AbstractNotificationsRegistrationWorker(
val httpClient = createHttpClient(okHttpClient)
return runCatching {
val response = httpClient.post("$INFOMANIAK_API_V1/devices/register") {
contentType(ContentType.Application.Json)
setBody(registrationInfo)
}
if (response.status.isSuccess()) {
Expand Down
Loading