f <- tempfile(fileext = ".json")
out <- crul::HttpClient$new("https://httpbin.org/get")$get(disk = f)
out$parse()
#> No encoding supplied: defaulting to UTF-8.
#> character(0)
#> Warning message:
#> In readBin(self$content, character()) :
#> incomplete string at end of file has been discarded
stream: parse() throws an error
f <- function(x) print(x)
out <- crul::HttpClient$new("https://httpbin.org/get")$get(stream = f)
out$content
#> NULL
out$parse()
#> Error in readBin(self$content, character()) : invalid connection
disk:
parse()
throws a warningstream:
parse()
throws an error