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

parse() improve behavior when using disk (prob. stream too) #104

Closed
sckott opened this issue Feb 9, 2019 · 0 comments
Closed

parse() improve behavior when using disk (prob. stream too) #104

sckott opened this issue Feb 9, 2019 · 0 comments
Milestone

Comments

@sckott
Copy link
Collaborator

sckott commented Feb 9, 2019

disk: parse() throws a warning

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
@sckott sckott added this to the v0.8 milestone Feb 9, 2019
@sckott sckott closed this as completed in 95abbb1 Feb 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant