Execute code with configuration set.

with_config(config = config(), expr, override = FALSE)

with_verbose(expr, ...)

Arguments

config

Settings as generated by add_headers(), set_cookies() or authenticate().

expr

code to execute under specified configuration

override

if TRUE, ignore existing settings, if FALSE, 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: 2018-12-17 20:45 #> Status: 200 #> Content-Type: text/html; charset=ISO-8859-1 #> Size: 12.3 kB #> <!doctype html><html itemscope="" itemtype="http://schema.org/WebPage" lang="... #> </style><style>body,td,a,p,.h{font-family:arial,sans-serif}body{margin:0;over... #> if (!iesg){document.f&&document.f.q.focus();document.gbqf&&document.gbqf.q.fo... #> } #> })();</script><div id="mngb"> <div id=gbar><nobr><b class=gb1>Search</b> <a c...
# Or even easier: with_verbose(GET("http://google.com"))
#> Response [http://www.google.com/] #> Date: 2018-12-17 20:45 #> Status: 200 #> Content-Type: text/html; charset=ISO-8859-1 #> Size: 12.3 kB #> <!doctype html><html itemscope="" itemtype="http://schema.org/WebPage" lang="... #> </style><style>body,td,a,p,.h{font-family:arial,sans-serif}body{margin:0;over... #> if (!iesg){document.f&&document.f.q.focus();document.gbqf&&document.gbqf.q.fo... #> } #> })();</script><div id="mngb"> <div id=gbar><nobr><b class=gb1>Search</b> <a c...