req_cookiemonster_set: Set cookies from the cookiejar to a httr2 request

View source: R/req_cookiemoster_set.r

req_cookiemonster_setR Documentation

Set cookies from the cookiejar to a httr2 request

Description

Adds all cookies for the domain from the jar to a httr2 request.

Usage

req_cookiemonster_set(req, jar = default_jar(), ...)

Arguments

req

A request object.

jar

A character string of the path to the cookie jar (the default is to use default_jar() to get a suitable directory).

...

not currently used.

Value

A request object (with cookies).

Examples


library(httr2)
domain <- url_parse(example_url())$hostname
add_cookies(cookiestring = "snicker=doodle; password=secret", domain = domain)
request(example_url()) |>
  req_url_path("/cookies/set") |>
  req_cookiemonster_set() |>
  req_perform() |>
  resp_body_json()


cookiemonster documentation built on Nov. 14, 2025, 1:08 a.m.