Comments (3)
Somewhat more minimal reprex:
library(httr2)
url <- "https://aloftdata.s3-eu-west-1.amazonaws.com/baltrad/hdf5/frbla/2021/02/28/frbla_vp_20210228T190000Z_0xb.h5"
reqs <- list(request(url))
resps <- req_perform_parallel(reqs, paths = withr::local_tempfile())
resps[[1]]
#> <httr2_response>
#> GET
#> https://aloftdata.s3-eu-west-1.amazonaws.com/baltrad/hdf5/frbla/2021/02/28/frbla_vp_20210228T190000Z_0xb.h5
#> Status: 200 OK
#> Content-Type: binary/octet-stream
#> Error in if (!resp_has_body(x)) {: missing value where TRUE/FALSE needed
Created on 2024-06-07 with reprex v2.1.0
Looks like the problem is that req_parallel()
doesn't create the file is the body is zero bytes. This is probably due to some difference between the single and multithreaded curl API, and could be resolved in Performance$succeed
by creating the file if it doesn't exist.
from httr2.
I'm using sequential downloads as a fallback on failed parallel downloads anyway, so by adding an extra condition to the fallback I was able to workaround this issue.
Ideally req_perform_parallel()
would just create the empty files, otherwise, an extra error message would be helpful so it's easier to figure out what's going wrong.
from httr2.
I think we can just fix this bug rather than emitting a message.
from httr2.
Related Issues (20)
- Self-signed certificates HOT 1
- netrc-based authentication HOT 2
- mocking iterative requests HOT 1
- `req_body_json()` should set `Content-Type: application/json` header HOT 1
- Allow users to persist authentication headers during redirects HOT 4
- Cannot capture 4xx response bodies with req_perform_stream HOT 6
- osmdata producing error due to httr2 HOT 1
- Add support for server-sent events
- url_build() doesn't validate argument
- Suggestion: Pass through auth_url from oauth_client$auth_params to oauth_flow/req_oauth HOT 1
- I don't understand req_auth_basic's behavior HOT 1
- Make `req_cache(debug = TRUE)` settable from an option
- Cannot upload more than 128 files using req_perform_parallel HOT 3
- Example wanted: Logging in to legacy API without OAuth 2.0 support and parsing token to oauth_token HOT 5
- `req_oauth_password` prompts password-input continuously, but existing valid token are used HOT 2
- `curl_translate()` bugs
- feature request: `req_perform_promise()` HOT 1
- Try S7
- Release httr2 1.0.2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from httr2.