Record test suite 'HTTP' requests and replays them during future runs. A port of the Ruby gem of the same name (https://github.com/vcr/vcr/). Works by recording real 'HTTP' requests/responses on disk in 'cassettes', and then replaying matching responses on subsequent requests.
A Ruby gem of the same name (VCR
, https://github.com/vcr/vcr) was
created many years ago and is the original. Ports in many languages
have been done. Check out that GitHub repo for all the details on
how the canonical version works.
The use_cassette()
function is most likely what you'll want to use. It
sets the cassette you want to record to, inserts the cassette, and then
ejects the cassette, recording the interactions to the cassette.
Alternatively, you can use insert_cassette()
for more control, but then
you have to make sure to use eject_cassette()
.
vcr_configure()
is the function to use to set R session-wide settings.
See its manual file for help.
As of crul v1.5, vcr
will work for async http requests with
crul. httr does not do async requests, and httr2
async plumbing does not have any hooks for mocking via webmockr
or recording real requests via this package.
Maintainer: Scott Chamberlain myrmecocystus@gmail.com (ORCID)
Authors:
Aaron Wolen (ORCID)
Maëlle Salmon (ORCID)
Daniel Possenriede (ORCID)
Hadley Wickham hadley@posit.co
Other contributors:
rOpenSci (019jywm96) [funder]