Skip to content

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() 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: 2022-05-04 12:21
#>   Status: 200
#>   Content-Type: text/html; charset=ISO-8859-1
#>   Size: 14.9 kB
#> <!doctype html><html itemscope="" itemtype="http://schema.org/WebPage" ...
#> var f=this||self;var h,k=[];function l(a){for(var b;a&&(!a.getAttribute...
#> function n(a,b,c,d,g){var e="";c||-1!==b.search("&ei=")||(e="&ei="+l(d)...
#> google.y={};google.sy=[];google.x=function(a,b){if(a)var c=a.id;else{do...
#> document.documentElement.addEventListener("submit",function(b){var a;if...
#> </style><style>body,td,a,p,.h{font-family:arial,sans-serif}body{margin:...
#> var f=this||self;var g,h=null!=(g=f.mei)?g:1,m,n=null!=(m=f.sdo)?m:!0,p...
#> e);var l=a.fileName;l&&(b+="&script="+c(l),e&&l===window.location.href&...
#> if (!iesg){document.f&&document.f.q.focus();document.gbqf&&document.gbq...
#> }
#> ...

# Or even easier:
with_verbose(GET("http://google.com"))
#> Response [http://www.google.com/]
#>   Date: 2022-05-04 12:21
#>   Status: 200
#>   Content-Type: text/html; charset=ISO-8859-1
#>   Size: 14.9 kB
#> <!doctype html><html itemscope="" itemtype="http://schema.org/WebPage" ...
#> var f=this||self;var h,k=[];function l(a){for(var b;a&&(!a.getAttribute...
#> function n(a,b,c,d,g){var e="";c||-1!==b.search("&ei=")||(e="&ei="+l(d)...
#> google.y={};google.sy=[];google.x=function(a,b){if(a)var c=a.id;else{do...
#> document.documentElement.addEventListener("submit",function(b){var a;if...
#> </style><style>body,td,a,p,.h{font-family:arial,sans-serif}body{margin:...
#> var f=this||self;var g,h=null!=(g=f.mei)?g:1,m,n=null!=(m=f.sdo)?m:!0,p...
#> e);var l=a.fileName;l&&(b+="&script="+c(l),e&&l===window.location.href&...
#> if (!iesg){document.f&&document.f.q.focus();document.gbqf&&document.gbq...
#> }
#> ...