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-02-13 21:42
#> Status: 200
#> Content-Type: text/html; charset=ISO-8859-1
#> Size: 17.8 kB
#> <!doctype html><html itemscope="" itemtype="http://schema.org/WebPag...
#> var g=this||self;function k(){return window.google&&window.google.kO...
#> function r(a,b,d,c,h){var e="";b.search("&ei=")===-1&&(e="&ei="+n(c)...
#> document.documentElement.addEventListener("submit",function(b){var a...
#> </style><style>body,td,a,p,.h{font-family:sans-serif}body{margin:0;o...
#> var g=this||self;var k,l=(k=g.mei)!=null?k:1,m,p=(m=g.diel)!=null?m:...
#> "&bver="+b(w.bv);w.dpf&&(c+="&dpf="+b(w.dpf));var f=a.lineNumber;f!=...
#> if (!iesg){document.f&&document.f.q.focus();document.gbqf&&document....
#> }
#> })();</script><div id="mngb"><div id=gbar><nobr><b class=gb1>Search<...
#> ...
# Or even easier:
with_verbose(GET("http://google.com"))
#> Response [http://www.google.com/]
#> Date: 2026-02-13 21:42
#> Status: 200
#> Content-Type: text/html; charset=ISO-8859-1
#> Size: 17.8 kB
#> <!doctype html><html itemscope="" itemtype="http://schema.org/WebPag...
#> var g=this||self;function k(){return window.google&&window.google.kO...
#> function r(a,b,d,c,h){var e="";b.search("&ei=")===-1&&(e="&ei="+n(c)...
#> document.documentElement.addEventListener("submit",function(b){var a...
#> </style><style>body,td,a,p,.h{font-family:sans-serif}body{margin:0;o...
#> var g=this||self;var k,l=(k=g.mei)!=null?k:1,m,p=(m=g.diel)!=null?m:...
#> "&bver="+b(w.bv);w.dpf&&(c+="&dpf="+b(w.dpf));var f=a.lineNumber;f!=...
#> if (!iesg){document.f&&document.f.q.focus();document.gbqf&&document....
#> }
#> })();</script><div id="mngb"><div id=gbar><nobr><b class=gb1>Search<...
#> ...