rstudio / plumber

Turn your R code into a web API.
https://www.rplumber.io
Other
1.39k stars 255 forks source link

Add a zip attachment example #922

Closed meztez closed 10 months ago

meztez commented 10 months ago

How to return multiple object in an archive. Adding an example. Not sure, if it should be added as a feature or the right API for it either.

as_attachment <- function(value, filename, ..., .list = NULL) {
  ...
}

What if the user wants to use different serializers for each file?

At least this is an example for the current version of plumber.

schloerke commented 10 months ago

What if the user wants to use different serializers for each file?

They'll need to handle it themselves in the route

schloerke commented 10 months ago

At least this is an example for the current version of plumber.

Yes. Even if we made a zip serializer, they would need to construct a folder with the content ready to go. It still leaves a clunky user interaction, so an example of how it's possible would be better.