mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-12 22:33:49 +00:00
Fixes #6284.
This commit is contained in:
@@ -1245,6 +1245,8 @@ proc downloadFile*(client: HttpClient | AsyncHttpClient,
|
||||
url: string, filename: string): Future[void] {.multisync.} =
|
||||
## Downloads ``url`` and saves it to ``filename``.
|
||||
client.getBody = false
|
||||
defer:
|
||||
client.getBody = true
|
||||
let resp = await client.get(url)
|
||||
|
||||
when client is HttpClient:
|
||||
|
||||
Reference in New Issue
Block a user