Programmatically process request

Is there a (documented) way to programmatically process a request ?

For example, I'd like to do:

PR <- pr("plumber.R")

my_req <-  create_a_request_object_here_somehow()
response <- pr_process_request(PR, my_req)

By looking quickly at the code, I found

PR$serve(req, res)

but that does not seem obvious how to create the corresponding req request.
Is this related to Rook (GitHub - jeffreyhorner/Rook: A web server interface for R) ?

Why would I want to do that ?
Because I want to use plumber in a AWS lambda function, running some R code.
The http requests are not directly exposed to the R code. They need to be fetched from the aws lamda runtime API (next_invocation). I could run a plumber http server, and forward explicitly the request, but that seems like an overkill.


Take a look at the test folder, there is some mock request in there.
Maybe you could get inspiration from there?

Search ยท make_req (

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.