Skip to main content

Data.download

Data.downloadurifilereplace_existingmethodheaders

Group: Web

Documentation

Fetches from the provided URI and if successful writes to the file. Returns an error if the status code does not represent a successful response.

Arguments

  • uri: The URI to fetch.
  • file: The file to write the response to.
  • replace_existing: Determines when download should proceed with the download, if the destination file already exists. (If the destination file does not exist, the download always proceeds). Options include: - If_Not_Exists: Download the file if it does not already exist on disk. (The default.) - If_Older_Than age: Download the file if the existing file is older than the specified age. - Always: Always download.
  • method: The HTTP method to use. Must be one of HTTP_Method.Get, HTTP_Method.Head, HTTP_Method.Delete, HTTP_Method.Options. Defaults to HTTP_Method.Get.
  • headers: The headers to send with the request. Defaults to an empty vector.