Hi all, I want to add download option in R plumber api,where a R markdown report will be download as word file.please let me know how to do it in plumber. I get some code,but its not working
#* @serializer contentType list(type="application/octet-stream")
#* @get /word
function(team, res){
res$setHeader("Content-Disposition", "attachment; filename=report.docx")
tmp <- tempfile()
render("test.Rmd", tmp, output_format = "word_document",
params = list(team = team))
readBin(tmp, "raw", n=file.info(tmp)$size)
}