Howdy! Is there a way to avoid or remove automati...
# ktor
i
Howdy! Is there a way to avoid or remove automatically added Accept header
application/json
?
Copy code
install(ContentNegotiation) {
    json()
}
The API I'm working with wants to deal with
application/vnd.api+json
only, and however I try to manipulate the headers, my requests are always sent with both (
Accept: application/vnd.api+json; application/json
) Thanks!
a
You can register a converter only for the
application/vnd.api+json
content type:
Copy code
install(ContentNegotiation) {
    register(ContentType.parse("application/vnd.api+json"), KotlinxSerializationConverter(DefaultJson))
}
i
Didn't know that, thank you very much Aleksei!