handles request matchers
registry
initialze registry list with a request, or leave empty
default_matchers
request matchers to use. default: method, uri
new()
Create a new RequestMatcherRegistry object
RequestMatcherRegistry$new(
registry = list(),
default_matchers = list("method", "uri")
)
registry
initialze registry list with a request, or leave empty
default_matchers
request matchers to use. default: method, uri
A new RequestMatcherRegistry
object
register()
Register a custom matcher
RequestMatcherRegistry$register(name, func)
name
matcher name
func
function that describes a matcher, should return a single boolean
no return; registers the matcher
register_built_ins()
Register all built in matchers
RequestMatcherRegistry$register_built_ins()
no return; registers all built in matchers
try_to_register_body_as_json()
Try to register body as JSON
RequestMatcherRegistry$try_to_register_body_as_json(r1, r2)
r1, r2
Request class objects
no return; registers the matcher
clone()
The objects of this class are cloneable with this method.
RequestMatcherRegistry$clone(deep = FALSE)
deep
Whether to make a deep clone.
if (FALSE) {
(x <- RequestMatcherRegistry$new())
x$default_matchers
x$registry
}
Run the code above in your browser using DataLab