Factor Documentation
|
Home
|
Glossary
|
Search
factorcode.org
download-to ( url file -- )
HTTP client
>
GET requests with the HTTP client
Prev:
download ( url -- )
Next:
<get-request> ( url -- request )
Vocabulary
http.client
Inputs and outputs
url
a
url
or
string
file
a pathname string
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
[
[
write
]
with-http-get
check-response
drop
]
with-file-writer
;