If I’m writing an HTTP4K route/handler that will r...
# http4k
n
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
Not sure what you mean - are you asking about content types setting, loading files from disk, the URL pattern ? 😉
s
@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
Excellent, thank you for the info!