Learn R Programming

rdav (version 0.3.0)

wd_connect: Establishes a connection to a WebDAV server

Description

Creates and authenticate a request handle to the WebDAV server

Usage

wd_connect(
  url,
  username = ncl_username_from_url(url),
  password = NULL,
  directory = "/"
)

Value

a httr2 request to the WebDAV server location

Arguments

url

url of the WebDAV directory

username

username - if not given, it will be derived from the url

password

password - if not given, you will be asked for it

directory

path to use as working directory

Details

Notice: it's not recommended to write the password as plain text. Either omit the parameter (then you will be asked to enter a password interactively) or use for example the system credential store via keyring package.

Examples

Run this code
if (FALSE) {
# establish a connection, you will be asked for a password

r <- wd_connect("https://example.com/remote.php/dav/files/myname","myname")


# establish a connection, use keyring package to retrieve the password

keyring::key_set("dav", "myname") # call only once

r <- wd_connect("https://example.com/remote.php/dav/files/myname",
                "myname",
                keyring::key_get("dav", "myname"))
}

Run the code above in your browser using DataLab