Handbook
Glossary
download-to ( url file -- )
HTTP client
ยป
GET requests with the HTTP client
Prev:
download ( url -- )
Next:
?download-to ( url file -- )
Vocabulary
http.client
Inputs
url
an
url
or a
string
file
a pathname string
Outputs
None
Word description
Downloads the contents of the URL to a file with the given pathname.
Errors
Throws an error if the HTTP request fails.
Definition
USING:
io
io.encodings.binary
io.files
kernel
;
IN:
http.client
:
download-to
( url file -- )
binary
[
<get-request>
[
write
]
with-http-request
drop
]
with-file-writer
;