https://kotlinlang.org logo
#http4k
Title
# http4k
n

Nezteb

08/05/2019, 9:19 PM
If I’m writing an HTTP4K route/handler that will return a file (CSV in this case), how would I specify that? Which page of the docs would have that info?
d

dave

08/05/2019, 9:26 PM
Not sure what you mean - are you asking about content types setting, loading files from disk, the URL pattern ? 😉
s

s4nchez

08/06/2019, 6:21 AM
@Nezteb additionally, apart from the contents of the file (String or Stream), you probably need to specify the headers
content-type=text/csv
and
content-disposition=inline; filename=my-file.csv
in order for it to be downloadable via browser.
👍 1
n

Nezteb

08/06/2019, 6:27 AM
Excellent, thank you for the info!
21 Views