I've noticed that !!! works for req_headers() but not for req_headers_redacted():
library(httr2)
x <- list("x-api-key" = "secret", "x-api-version" = "2025-01-01")
req_headers(
request("https://posit.co"),
!!!x
)
#> <httr2_request>
#> GET https://posit.co
#> Headers:
#> • x-api-key: "secret"
#> • x-api-version: "2025-01-01"
#> Body: empty
req_headers_redacted(
request("https://posit.co"),
!!!x
)
#> Error in !x: invalid argument type
Created on 2025-01-21 with reprex v2.1.1
Pretty sure this is due to the use of list(...) in the source of the req_headers_redacted() rather than list2(...), as used in req_headers().
I've noticed that
!!!works forreq_headers()but not forreq_headers_redacted():Created on 2025-01-21 with reprex v2.1.1
Pretty sure this is due to the use of
list(...)in the source of thereq_headers_redacted()rather thanlist2(...), as used inreq_headers().