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: 2026-02-13 21:41
#>   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<...
#> ...
set_config(verbose())
GET("http://google.com")
#> Response [http://www.google.com/]
#>   Date: 2026-02-13 21:41
#>   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<...
#> ...
reset_config()
GET("http://google.com")
#> Response [http://www.google.com/]
#>   Date: 2026-02-13 21:41
#>   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<...
#> ...