View source: R/webmockr-opts.R
webmockr_configure | R Documentation |
webmockr configuration
webmockr_configure(
allow_net_connect = FALSE,
allow_localhost = FALSE,
allow = NULL,
show_stubbing_instructions = TRUE,
show_body_diff = FALSE
)
webmockr_configure_reset()
webmockr_configuration()
webmockr_allow_net_connect()
webmockr_disable_net_connect(allow = NULL)
webmockr_net_connect_allowed(uri = NULL)
allow_net_connect |
(logical) Default: |
allow_localhost |
(logical) Default: |
allow |
(character) one or more URI/URL to allow (and by extension all others are not allowed) |
show_stubbing_instructions |
(logical) Default: |
show_body_diff |
(logical) Default: |
uri |
(character) a URI/URL as a character string - to determine whether or not it is allowed |
If there are stubs found for a request, even if net connections are
allowed (by running webmockr_allow_net_connect()
) the stubbed
response will be returned. If no stub is found, and net connections
are allowed, then a real HTTP request can be made.
## Not run:
webmockr_configure()
webmockr_configure(
allow_localhost = TRUE
)
webmockr_configuration()
webmockr_configure_reset()
webmockr_allow_net_connect()
webmockr_net_connect_allowed()
# disable net connect for any URIs
webmockr_disable_net_connect()
### gives NULL with no URI passed
webmockr_net_connect_allowed()
# disable net connect EXCEPT FOR given URIs
webmockr_disable_net_connect(allow = "google.com")
### is a specific URI allowed?
webmockr_net_connect_allowed("google.com")
# show body diff
webmockr_configure(show_body_diff = TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.