Skip to content

Set (and reset) global httr configuration.

Usage

set_config(config, override = FALSE)

reset_config()

Arguments

config

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

override

if TRUE, ignore existing settings, if FALSE, combine new config with old.

Value

invisibility, the old global config.

See also

Other ways to set configuration: config(), with_config()

Examples

GET("http://google.com")
#> Response [http://www.google.com/]
#>   Date: 2022-08-17 14:42
#>   Status: 200
#>   Content-Type: text/html; charset=ISO-8859-1
#>   Size: 13.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 h=this||self;var k,l=null!=(k=h.mei)?k:1,n,p=null!=(n=h.sdo)?n:!0,q...
#> a.fileName;g&&(0<g.indexOf("-extension:/")&&(e=3),c+="&script="+b(g),f&...
#> if (!iesg){document.f&&document.f.q.focus();document.gbqf&&document.gbq...
#> }
#> ...
set_config(verbose())
GET("http://google.com")
#> Response [http://www.google.com/]
#>   Date: 2022-08-17 14:42
#>   Status: 200
#>   Content-Type: text/html; charset=ISO-8859-1
#>   Size: 13.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 h=this||self;var k,l=null!=(k=h.mei)?k:1,n,p=null!=(n=h.sdo)?n:!0,q...
#> a.fileName;g&&(0<g.indexOf("-extension:/")&&(e=3),c+="&script="+b(g),f&...
#> if (!iesg){document.f&&document.f.q.focus();document.gbqf&&document.gbq...
#> }
#> ...
reset_config()
GET("http://google.com")
#> Response [http://www.google.com/]
#>   Date: 2022-08-17 14:42
#>   Status: 200
#>   Content-Type: text/html; charset=ISO-8859-1
#>   Size: 13.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 h=this||self;var k,l=null!=(k=h.mei)?k:1,n,p=null!=(n=h.sdo)?n:!0,q...
#> a.fileName;g&&(0<g.indexOf("-extension:/")&&(e=3),c+="&script="+b(g),f&...
#> if (!iesg){document.f&&document.f.q.focus();document.gbqf&&document.gbq...
#> }
#> ...