Closed
Description
Hi, I'm using sttp with ZIO to download quite large files via an API.
It looks something like this:
def downloadRequest(uri: Uri, fileName: String, apiKey: String) = basicRequest
.auth.basic("apikey", apiToken)
.get(uri)
.response(asFile(new File(fileName)))
def download(): IO[Exception, File] =
for
backend <- HttpClientZioBackend()
response <- downloadRequest(...).send(backend)
file <- ZIO.fromEither(response.body).mapError(e => new Exception(s"Download failed: $e")))
yield
file
How would you go about getting updates about how far the download is?
Metadata
Metadata
Assignees
Labels
No labels