Fixes #6284.
This commit is contained in:
parent
a3f82a574f
commit
b47e448e06
1 changed files with 2 additions and 0 deletions
|
|
@ -1245,6 +1245,8 @@ proc downloadFile*(client: HttpClient | AsyncHttpClient,
|
||||||
url: string, filename: string): Future[void] {.multisync.} =
|
url: string, filename: string): Future[void] {.multisync.} =
|
||||||
## Downloads ``url`` and saves it to ``filename``.
|
## Downloads ``url`` and saves it to ``filename``.
|
||||||
client.getBody = false
|
client.getBody = false
|
||||||
|
defer:
|
||||||
|
client.getBody = true
|
||||||
let resp = await client.get(url)
|
let resp = await client.get(url)
|
||||||
|
|
||||||
when client is HttpClient:
|
when client is HttpClient:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue