https://kotlinlang.org logo
#ktor
Title
# ktor
b

bitkid

09/03/2020, 8:58 AM
Hey! Does anyone know how i can get around "Header Content-Type is controlled by the engine and cannot be set explicitly" My app can return JSON and CSV and the format is controlled by the Accept header in the request. I can set the content type explicitly to text/csv when using respondOutputStream or streamDirect but i can't use it with call.respond("my csv, as text").
ah found it:
Copy code
call.respondText(ContentType.Text.CSV, httpStatusCode) {
    "bla, csv"
}
3 Views