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-09-01 14:21
#>   Status: 200
#>   Content-Type: text/html; charset=ISO-8859-1
#>   Size: 83.2 kB
#> <!doctype html><html itemscope="" itemtype="http://schema.org/WebPag...
#> var h=this||self;var k=/#|$/;function l(a,c){var e=a.search(k);a:{va...
#> function t(a,c,e,b,f){var d="";c.search("&ei=")===-1&&(d="&ei="+p(b)...
#> document.documentElement.addEventListener("submit",function(b){var a...
#> try{
#> _._F_toggles_initialize=function(a){(typeof globalThis!=="undefined"...
#> /*
#> 
#>  Copyright The Closure Library Authors.
#>  SPDX-License-Identifier: Apache-2.0
#> ...
set_config(verbose())
GET("http://google.com")
#> Response [http://www.google.com/]
#>   Date: 2026-09-01 14:21
#>   Status: 200
#>   Content-Type: text/html; charset=ISO-8859-1
#>   Size: 83.2 kB
#> <!doctype html><html itemscope="" itemtype="http://schema.org/WebPag...
#> var h=this||self;var k=/#|$/;function l(a,c){var e=a.search(k);a:{va...
#> function t(a,c,e,b,f){var d="";c.search("&ei=")===-1&&(d="&ei="+p(b)...
#> document.documentElement.addEventListener("submit",function(b){var a...
#> try{
#> _._F_toggles_initialize=function(a){(typeof globalThis!=="undefined"...
#> /*
#> 
#>  Copyright The Closure Library Authors.
#>  SPDX-License-Identifier: Apache-2.0
#> ...
reset_config()
GET("http://google.com")
#> Response [http://www.google.com/]
#>   Date: 2026-09-01 14:21
#>   Status: 200
#>   Content-Type: text/html; charset=ISO-8859-1
#>   Size: 83.2 kB
#> <!doctype html><html itemscope="" itemtype="http://schema.org/WebPag...
#> var h=this||self;var k=/#|$/;function l(a,c){var e=a.search(k);a:{va...
#> function t(a,c,e,b,f){var d="";c.search("&ei=")===-1&&(d="&ei="+p(b)...
#> document.documentElement.addEventListener("submit",function(b){var a...
#> try{
#> _._F_toggles_initialize=function(a){(typeof globalThis!=="undefined"...
#> /*
#> 
#>  Copyright The Closure Library Authors.
#>  SPDX-License-Identifier: Apache-2.0
#> ...