Retrieve custom headers set on the request. Use req_dry_run() to get all
headers, including those automatically generated by curl.
req_get_headers(req, redacted = c("drop", "redact", "reveal"))A httr2 request object.
What to do with redacted headers?
"drop" (the default) drops them.
"redact" replaces them with <REDACTED>.
"reveal" leaves them in place.
A named list.
req <- request("http://example.com")
req <- req_headers(req, a = 1L, b = 2L, .redact = "a")
req_get_headers(req, "drop")
#> $b
#> [1] "2"
#>
req_get_headers(req, "redact")
#> $a
#> [1] "<REDACTED>"
#>
#> $b
#> [1] "2"
#>
req_get_headers(req, "reveal")
#> $a
#> [1] "1"
#>
#> $b
#> [1] "2"
#>