| Cassette | R Documentation |
Main R6 class that is called from the main user facing
function use_cassette()
An R6 Cassette pbject.
name(character) cassette name
record(character) record mode
serialize_with(character) serializer (yaml|json|qs2)
serializer(Serializer) serializer (YAML|JSON|QS2)
match_requests_on(character) matchers to use
re_record_interval(numeric) the re-record interval
root_dirroot dir, gathered from vcr_configuration()
preserve_exact_body_bytes(logical) Whether to base64 encode the bytes of the requests and responses
http_interactions(list) internal use
new_interactions(boolean) Have any interactions been recorded?
warn_on_empty(logical) warn if no interactions recorded
new_cassetteis this a new cassette?
new()Create a new Cassette object
Cassette$new( name, dir = NULL, record = NULL, match_requests_on = NULL, serialize_with = NULL, preserve_exact_body_bytes = NULL, re_record_interval = NULL, warn_on_empty = NULL )
nameThe name of the cassette. vcr will sanitize this to ensure it is a valid file name.
dirThe directory where the cassette will be stored.
recordThe record mode. Default: "once".
match_requests_onHTTP request components to use when matching.
serialize_with(character) Which serializer to use. Valid values are "yaml" (default), "json", and "qs2".
preserve_exact_body_bytes(logical) Whether or not
to base64 encode the bytes of the requests and responses for
this cassette when serializing it. See also preserve_exact_body_bytes
in vcr_configure(). Default: FALSE
re_record_interval(numeric) When given, the cassette will be re-recorded at the given interval, in seconds.
warn_on_emptyWarn when ejecting the cassette if no interactions have been recorded.
A new Cassette object
insert()insert the cassette
Cassette$insert()
self
eject()ejects the cassette
Cassette$eject()
self
print()print method for Cassette objects
Cassette$print(x, ...)
xself
...ignored
file()get the file path for the cassette
Cassette$file()
character
recording()Is the cassette in recording mode?
Cassette$recording()
logical
replaying()Is the cassette in replaying mode?
Cassette$replaying()
logical
remove_outdated_interactions()Remove outdated interactions
Cassette$remove_outdated_interactions()
record_http_interaction()record an http interaction (doesn't write to disk)
Cassette$record_http_interaction(request, response)
requestA vcr_request.
responseA vcr_response.
an interaction as a list with request and response slots
clone()The objects of this class are cloneable with this method.
Cassette$clone(deep = FALSE)
deepWhether to make a deep clone.
vcr_configure(), use_cassette(), insert_cassette()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.