Learn R Programming

ambiorix (version 2.2.0)

default_cookie_parser: Cookie Parser

Description

Parses the cookie string.

Usage

default_cookie_parser(req)

Value

A list of key value pairs or cookie values.

Arguments

req

A Request.

Examples

Run this code
if (interactive()) {
  library(ambiorix)

  #' Handle GET at '/greet'
  #'
  #' @export
  say_hello <- function(req, res) {
    cookies <- default_cookie_parser(req)
    print(cookies)

    res$send("hello there!")
  }

  app <- Ambiorix$new()
  app$get("/greet", say_hello)
  app$start()
}

Run the code above in your browser using DataLab