jeffreyhorner / Rook

A web server interface for R
161 stars 30 forks source link

Add sendbin method to Response class #8

Open jeroen opened 11 years ago

jeroen commented 11 years ago

The Response class has a method write to add text to the body field. However, I cannot find a method to send a file or raw vector? E.g. something like:

res <- Response$new();
mytemp <- tempfile();
png(mytemp);
hist(rnorm(1e5));
dev.off();
res$header("content-type", "image/png")
res$sendbin(mytemp);