Introduction to vcr

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

vcr introduction

vcr is an R port of the Ruby gem VCR (i.e., a translation, there's no Ruby here :))

vcr helps you stub and record HTTP requests so you don't have to repeat HTTP requests.

The main use case is for unit tests, but you can use it outside of the unit test use case.

vcr works with the crul and httr HTTP request packages.

Check out the HTTP testing book for a lot more documentation on vcr, webmockr, and crul, and other packages.

Elevator pitch


Installation

CRAN

install.packages("vcr")

Development version

remotes::install_github("ropensci/vcr")
library("vcr")

Getting Started


Basic usage


Terminology


Workflows


Configuration


Matching/Matchers


Note about missing features




Try the vcr package in your browser

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

vcr documentation built on June 1, 2021, 1:06 a.m.