Skip to content

Conversation

colincasey
Copy link
Contributor

@colincasey colincasey commented Sep 5, 2025

Introduces the http feature which provides a consistent methods to make GET requests:

  • http::get(...)

    • Configurable timeouts & retries
    • OTel tracing of requests
    • Supports sync/async usage
    • Platform certificate store support
  • http::get(...).call().and_then(|res| res.download_to_file(path))

    • Streams the request body directly to the given file path
  • http::bullet_stream_request_logger()

    • Only available when the bullet_stream feature is also enabled
    • Creates a logger that provides consistent output via bullet_stream

Introduces the following features to the `download_file` utility function:
- Configurable timeouts & retries
- OTel tracing of requests
- Sync/async usage
- Platform certificate store support
- Consistent output via `bullet_stream`

This replaces the usage of `ureq` as the HTTP client library so it wasn't possible to make this change fully backwards-compatible as the previous `DownloadError` enum leaked this internal implementation detail.

The `download_file` function is also marked as deprecated. It should be replaced with the following which offers a bit more flexibility:

```rust
get(uri.as_ref())
  .call_sync()
  .and_then(|res| res.download_to_file_sync(destination));
```
@colincasey colincasey added the enhancement New feature or request label Sep 5, 2025
@colincasey colincasey requested a review from Malax September 5, 2025 17:30
@colincasey colincasey marked this pull request as ready for review September 17, 2025 15:44
@colincasey colincasey requested a review from a team as a code owner September 17, 2025 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant