]> gitweb.factorcode.org Git - factor.git/blob - basis/http/download/download-docs.factor
http.download: move download words to their own vocabulary
[factor.git] / basis / http / download / download-docs.factor
1 ! Copyright (C) 2024 Doug Coleman.
2 ! See https://factorcode.org/license.txt for BSD license.
3 USING: calendar help.markup help.syntax io.pathnames kernel math
4 strings urls ;
5 IN: http.download
6
7 HELP: download
8 { $values { "url" { $or url string } } { "path" "a pathname string" } }
9 { $description "Downloads the contents of the URL to a file in the " { $link current-directory } " having the same file name and returns the pathname." }
10 { $errors "Throws an error if the HTTP request fails." } ;
11
12 HELP: download-to
13 { $values { "url" { $or url string } } { "file" "a pathname string" } { "path" "a pathname string" } }
14 { $description "Downloads the contents of the URL to a file with the given pathname and returns the pathname." }
15 { $errors "Throws an error if the HTTP request fails." } ;
16
17
18 ARTICLE: "http.download" "HTTP Download Utilities"
19 "The " { $vocab-link "http.download" } " vocabulary provides utilities for downloading files from the web."
20
21 "Utilities to retrieve a " { $link url } " and save the contents to a file:"
22 { $subsections
23     download
24     download-to
25 }
26 ;
27
28 ABOUT: "http.download"