Serving JSON and XML from One Ktor Endpoint with Content Negotiation
Ktor's ContentNegotiation plugin lets one route serve JSON and XML based on the client's Accept header. Here's how to configure it, when to override it per route, and how to test the negotiation contract.