This will set the appropriate fields in the Content-Disposition
header value.
To make sure the attachment is used, be sure your serializer eventually calls serializer_headers
as_attachment(value, filename = NULL)
Object with class "plumber_attachment"
if (FALSE) { # \dontrun{
# plumber.R
#' @get /data
#' @serializer csv
function() {
# will cause the file to be saved as `iris.csv`, not `data` or `data.csv`
as_attachment(iris, "iris.csv")
}
} # }