Why is Ktor client sending `Accept: application/xm...
# ktor
r
Why is Ktor client sending
Accept: application/xml;application/json
header when I call:
Copy code
<http://httpClient.post|httpClient.post>(serviceUrl) {
                contentType(ContentType.Application.Json)
                accept(ContentType.Application.Xml)
                body = MyClass(...)
            }
Does such header even conform to HTTP standard?
This is how httpClient is defined:
Copy code
val httpClient = HttpClient(Apache) {
        install(JsonFeature) {
            serializer = KotlinxSerializer()
        }
        engine {
            socketTimeout = 60_000
        }
    }
Content types in the
Accept
header should be separated by a comma, am I right?
👍 1
d
oh no, parameters are separated by semicolon
Copy code
Accept: text/plain; q=0.5, text/html, text/x-dvi; q=0.8, text/x-c
r