Execute code with configuration set.
Usage
with_config(config = config(), expr, override = FALSE)
with_verbose(expr, ...)Arguments
- config
Settings as generated by
add_headers(),set_cookies()orauthenticate().- expr
code to execute under specified configuration
- override
if
TRUE, ignore existing settings, ifFALSE, combine new config with old.- ...
Other arguments passed on to
verbose()
See also
Other ways to set configuration:
config(),
set_config()
Examples
with_config(verbose(), {
GET("http://had.co.nz")
GET("http://google.com")
})
#> Response [http://www.google.com/]
#> Date: 2026-09-01 14:21
#> Status: 200
#> Content-Type: text/html; charset=ISO-8859-1
#> Size: 83.2 kB
#> <!doctype html><html itemscope="" itemtype="http://schema.org/WebPag...
#> var h=this||self;var k=/#|$/;function l(a,c){var e=a.search(k);a:{va...
#> function t(a,c,e,b,f){var d="";c.search("&ei=")===-1&&(d="&ei="+p(b)...
#> document.documentElement.addEventListener("submit",function(b){var a...
#> try{
#> _._F_toggles_initialize=function(a){(typeof globalThis!=="undefined"...
#> /*
#>
#> Copyright The Closure Library Authors.
#> SPDX-License-Identifier: Apache-2.0
#> ...
# Or even easier:
with_verbose(GET("http://google.com"))
#> Response [http://www.google.com/]
#> Date: 2026-09-01 14:21
#> Status: 200
#> Content-Type: text/html; charset=ISO-8859-1
#> Size: 83.2 kB
#> <!doctype html><html itemscope="" itemtype="http://schema.org/WebPag...
#> var h=this||self;var k=/#|$/;function l(a,c){var e=a.search(k);a:{va...
#> function t(a,c,e,b,f){var d="";c.search("&ei=")===-1&&(d="&ei="+p(b)...
#> document.documentElement.addEventListener("submit",function(b){var a...
#> try{
#> _._F_toggles_initialize=function(a){(typeof globalThis!=="undefined"...
#> /*
#>
#> Copyright The Closure Library Authors.
#> SPDX-License-Identifier: Apache-2.0
#> ...