download: Download a file

Description Usage Arguments Details Value

Description

Uses either the curl package for R versions older than 3.2.0, otherwise a wrapper around download.file().

Usage

1
2
download(path, url, auth_token = NULL, basic_auth = NULL,
  quiet = TRUE, headers = NULL)

Arguments

path

Path to download to. dirname(path) must exist.

url

URL.

auth_token

Token for token-based authentication or NULL.

basic_auth

List with user and password for basic HTTP authentication, or NULL.

quiet

Passed to download.file() or curl::curl_download().

headers

Named character vector of HTTP headers to use.

Details

We respect the download.file.method setting of the user. If it is not set, then see download_method() for choosing a method.

Authentication can be supplied three ways:

If both auth_token and basic_auth are specified, that's an error. auth_token and basic_auth are appended to headers, so they take precedence over an Authorization header that is specified directly in headers.

Value

path, if the download was successful.


remotes documentation built on June 25, 2019, 1:03 a.m.