Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Writing to disk does not yet work with httr2 #270

Open
sckott opened this issue Sep 4, 2024 · 0 comments
Open

Writing to disk does not yet work with httr2 #270

sckott opened this issue Sep 4, 2024 · 0 comments
Labels

Comments

@sckott
Copy link
Collaborator

sckott commented Sep 4, 2024

library(vcr)
library(httr2)

tmpdir <- tempdir()
invisible(vcr_configure(
  dir = file.path(tmpdir, "fixtures"),
  write_disk_path = file.path(tmpdir, "files")
))

my_file <- tempfile(tmpdir = file.path(tmpdir, "files"))

use_cassette(name = "stuff2", {
  request("https://google.com") |> req_perform(path = my_file)
})

readLines(my_file)
#> Warning in file(con, "r"): cannot open file
#> '/var/folders/qt/fzq1m_bj2yb_7b2jz57s9q7c0000gp/T//Rtmp8tCUFj/files/file6ec3313ed849':
#> No such file or directory
#> Error in file(con, "r"): cannot open the connection

Created on 2024-09-04 with reprex v2.1.1

@sckott sckott added the httr2 label Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant