## ----echo=FALSE---------------------------------------------------------------
knitr::opts_chunk$set(
	comment = "#>",
	collapse = TRUE,
	warning = FALSE,
	message = FALSE,
	eval = FALSE
)

## -----------------------------------------------------------------------------
# library("vcr")

## -----------------------------------------------------------------------------
library("vcr")

## -----------------------------------------------------------------------------
vcr_config_defaults()

## -----------------------------------------------------------------------------
vcr_configure(
  dir = "foobar/vcr_cassettes"
)

## -----------------------------------------------------------------------------
vcr_configure(
  dir = "foobar/vcr_cassettes",
  record = "all"
)

## -----------------------------------------------------------------------------
vcr_configure_reset()

## -----------------------------------------------------------------------------
vcr_configure(dir = "new/path")

## -----------------------------------------------------------------------------
vcr_configure(record = "new_episodes")

## -----------------------------------------------------------------------------
vcr_configure(match_requests_on = c('query', 'headers'))

## -----------------------------------------------------------------------------
vcr_configure(allow_unused_http_interactions = FALSE)

## -----------------------------------------------------------------------------
vcr_configure(serialize_with = "yaml")

## -----------------------------------------------------------------------------
vcr_configure(persist_with = "FileSystem")

## -----------------------------------------------------------------------------
vcr_configure(ignore_hosts = "google.com")

## -----------------------------------------------------------------------------
vcr_configure(ignore_localhost = TRUE)

## ----eval=FALSE---------------------------------------------------------------
# vcr_configure(ignore_hosts = "google.com")
# use_cassette("foo_bar", {
#   crul::HttpClient$new("https://httpbin.org/get")$get()
#   crul::HttpClient$new("https://google.com")$get()
# })

## -----------------------------------------------------------------------------
vcr_configure(uri_parser = "urltools::url_parse")

## -----------------------------------------------------------------------------
vcr_configure(preserve_exact_body_bytes = TRUE)