problem-details-ktor-client-xml
Ktor Client integration for the Appendix B XML form: turn a recognized application/problem+xml error response into the same io.github.ilyankin.rfc9457.ProblemException that application code throws on the server side and problem-details-ktor answers.
Registering the XML codec is what pulls in an XML parser, exactly as on the server: an application that only ever decodes JSON depends on problem-details-ktor-client alone and never resolves xmlutil.
Published for jvm, js, wasmJs, linuxX64, linuxArm64, mingwX64, macosArm64, iosArm64 and iosSimulatorArm64. Depend on the plain coordinates from commonMain and Gradle picks the variant.
Both formats
val client = HttpClient(CIO) {
expectSuccess = true
HttpResponseValidator {
problemJson()
problemXml()
}
}Order does not matter here, unlike the server's ContentNegotiation pair, where whichever converter is registered first wins an absent or wildcard Accept. These two gate on Content-Type instead, and the two types they match are disjoint, so neither can shadow the other. Pinned in both directions by RegistrationOrderTest.
expectSuccess = true is required for the same reason as on the JSON side: without it Ktor throws nothing for a non-2xx response, so there is no exception to intercept and replace.