inst/doc/knitr-test.R

## -----------------------------------------------------------------------------
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

library(vcr)
library(httr2)
httpbin <- webfakes::local_app_process(webfakes::httpbin_app())

# Set record = "none" so that this vignette will fail if it doesn't replay
# from the cassette
vcr::setup_knitr(record = "none")

## -----------------------------------------------------------------------------
req <- request(httpbin$url("/get"))
req_perform(req)

## -----------------------------------------------------------------------------
req <- request(httpbin$url("/get?x=1"))
req_perform(req)

Try the vcr package in your browser

Any scripts or data that you put into this service are public.

vcr documentation built on Aug. 8, 2025, 6:45 p.m.