-
Notifications
You must be signed in to change notification settings - Fork 80
Closed
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behavior
Milestone
Description
Writing a script that converts my browser's network requests to <httr2_request> objects.
Since print.httr2_request doesn't cli:::cli_escape headers, I get an error when I try to print a network request with curly bois in its headers.
library(httr2)
#> Warning: package 'httr2' was built under R version 4.3.3
my_request <- "http://example-site.com" |>
request() |>
req_headers(`oddly-formatted-header` = "{\"some-website\":\"puts-jsoney-stuff-here\"}")
my_request
#> <httr2_request>
#> GET http://example-site.com
#> Headers:
#> Warning in eval(expr, envir = envir): NAs introduced by coercion
#> Warning in eval(expr, envir = envir): NAs introduced by coercion
#> Error in "cli::cli_li(paste0(\"{.field \", names(x), \"}: \", vals))": ! Could not evaluate cli `{}` expression: `"some-website":"put…`.
#> Caused by error in `"some-website":"puts-jsoney-stuff-here"`:
#> ! NA/NaN argumentMetadata
Metadata
Assignees
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behavior