Learn R Programming

ambiorix (version 2.2.0)

as_cookie_preprocessor: Define a Cookie Preprocessor

Description

Identifies a function as a cookie preprocessor.

Usage

as_cookie_preprocessor(fn)

Value

Object of class "cookiePreprocessor".

Arguments

fn

A function that accepts the same arguments as the cookie method of the Response class (name, value, ...), and returns a modified value.

Examples

Run this code
func <- function(name, value, ...) {
 sprintf("prefix.%s", value)
}

prep <- as_cookie_preprocessor(func)

app <- Ambiorix$new()
app$use(prep)

Run the code above in your browser using DataLab