Appendix B — plumber: The Missing Manual
B.1 Introduction
This is an appendix. I hope to not need this, but for now I’m planning to document things in plumber that aren’t well-documented by plumber itself. These are things that I had to dig through code to find.
B.2 Response Methods
The res object that’s available in most plumber functions is an R6 object defined in PlumberResponse
. It has these public methods (partially documented in the Rendering Output Vignette:
setHeader(name, value)
toResponse()
(hidden inputs:self$headers
,self$body
,self$status
)setCookie(name, value, path = NULL, expiration = FALSE, http = FALSE, secure = FALSE, same_site = FALSE)
- Kinda documented in session_cookie() (and related docs), but it isn’t clear until you dig.
removeCookies(name, path = NULL, http = FALSE, secure = FALSE, same_site = FALSE, ...)
...
isn’t used- Sends a directive to expire the cookie “Thu, 01 Jan 1970 00:00:00 GMT”, which hopefully results in the cookie being deleted.