Skip to content

Commit f497e79

Browse files
committed
Epostrequest må ha json ContentType
1 parent 69a41eb commit f497e79

File tree

1 file changed

+8
-0
lines changed
  • app/src/main/kotlin/no/nav/hjelpemidler/soknad/db/rapportering/epost

1 file changed

+8
-0
lines changed

app/src/main/kotlin/no/nav/hjelpemidler/soknad/db/rapportering/epost/GraphClient.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ package no.nav.hjelpemidler.soknad.db.rapportering.epost
33
import io.github.oshai.kotlinlogging.KotlinLogging
44
import io.ktor.client.HttpClient
55
import io.ktor.client.engine.apache.Apache
6+
import io.ktor.client.plugins.defaultRequest
7+
import io.ktor.client.request.accept
68
import io.ktor.client.request.post
79
import io.ktor.client.request.setBody
10+
import io.ktor.http.ContentType
11+
import io.ktor.http.contentType
812
import kotlinx.coroutines.Dispatchers
913
import kotlinx.coroutines.withContext
1014
import no.nav.hjelpemidler.http.createHttpClient
@@ -17,6 +21,10 @@ class GraphClient(
1721
private val openIDClient: OpenIDClient,
1822
private val httpClient: HttpClient = createHttpClient(Apache.create()) {
1923
expectSuccess = true
24+
defaultRequest {
25+
accept(ContentType.Application.Json)
26+
contentType(ContentType.Application.Json)
27+
}
2028
},
2129
private val baseUrl: String = "https://graph.microsoft.com/v1.0",
2230
private val scope: String = "https://graph.microsoft.com/.default",

0 commit comments

Comments
 (0)