View source: R/configuration.R
vcr_configure | R Documentation |
Configurable options that define vcr's default behavior.
vcr_configure(
dir,
record,
match_requests_on,
serialize_with,
json_pretty,
ignore_hosts,
ignore_localhost,
preserve_exact_body_bytes,
turned_off,
re_record_interval,
log,
log_opts,
filter_sensitive_data,
filter_sensitive_data_regex,
filter_request_headers,
filter_response_headers,
filter_query_parameters,
write_disk_path,
warn_on_empty_cassette
)
local_vcr_configure(..., .frame = parent.frame())
vcr_configure_reset()
vcr_configuration()
vcr_config_defaults()
dir |
Directory where cassettes are stored. |
record |
Record mode that dictates how HTTP requests/responses are recorded. Possible values are:
|
match_requests_on |
Character vector of request matchers used to
determine which recorded HTTP interaction to replay. The default matches
on the The full set of possible values are:
If more than one is specified, all components must match in order for the
request to match. If not supplied, defaults to Note that the request header and body will only be included in the
cassette if |
serialize_with |
(string) Which serializer to use:
|
json_pretty |
(logical) want JSON to be newline separated to be easier
to read? Or remove newlines to save disk space? default: |
ignore_hosts |
(character) Vector of hosts to ignore. e.g.,
|
ignore_localhost |
(logical) Default: |
preserve_exact_body_bytes |
(logical) Force a binary (base64)
representation of the request and response bodies? By default, vcr
will look at the |
turned_off |
(logical) VCR is turned on by default. Default:
|
re_record_interval |
(integer) How frequently (in seconds) the
cassette should be re-recorded. Default: |
log , log_opts |
See |
filter_sensitive_data , filter_sensitive_data_regex |
Transform header and/or body in the request and response.
Named list of substitutions to apply to the headers and body of the
request and response. Format is |
filter_request_headers , filter_response_headers |
Filter request or response headers. Should be a list:
unnamed components are removed, and named components are transformed.
For example, httr2's redacted headers are automatically removed. |
filter_query_parameters |
Filter query parameters in the request. A list where unnamed components
are removed, and named components are transformed. For example,
|
write_disk_path |
(character) path to write files to
for any requests that write responses to disk. By default this will be
|
warn_on_empty_cassette |
(logical) Should a warning be thrown when an
empty cassette is detected? Empty cassettes are cleaned up (deleted) either
way. This option only determines whether a warning is thrown or not.
Default: |
... |
Configuration settings used to override defaults. |
.frame |
Attach exit handlers to this environment. Typically, this
should be either the current environment or a parent frame (accessed
through |
vcr_configure(dir = tempdir())
vcr_configure(dir = tempdir(), record = "all")
vcr_configuration()
vcr_config_defaults()
vcr_configure(dir = tempdir(), ignore_hosts = "google.com")
vcr_configure(dir = tempdir(), ignore_localhost = TRUE)
# filter sensitive data
vcr_configure(dir = tempdir(),
filter_sensitive_data = list(foo = "<bar>")
)
vcr_configure(dir = tempdir(),
filter_sensitive_data = list(foo = "<bar>", hello = "<world>")
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.