Learn R Programming

plumber (version 1.3.0)

forward: Forward Request to The Next Handler

Description

This function is used when a filter is done processing a request and wishes to pass control off to the next handler in the chain. If this is not called by a filter, the assumption is that the filter fully handled the request itself and no other filters or endpoints should be evaluated for this request. forward() cannot be used within handlers to trigger the next matching handler in the router. It only has relevance for filters.

Usage

forward()

Arguments

Examples

Run this code
if (FALSE) {
pr() %>%
  pr_filter("foo", function(req, res) {
    print("This is filter foo")
    forward()
  }) %>%
  pr_run()
}

Run the code above in your browser using DataLab