Skip to contents

Obtains thecontents of one or more url's from the OpenCPU server response in a list.

Usage

download_as_list(resp, pattern = "R/.val")

Arguments

resp

An object of class httr::response(), typically returned by a previous call to httr::POST to the server.

pattern

A character vector with the trailing part of the requested url, e.g. "R/.val" or "stdout". Use "" to obtain all results.

Value

A list with the contents under the url's that match pattern. The result has length 0 if the pattern was not found.

Examples

if (FALSE) {
file <- file.path(path.package("jamesclient"), "testdata", "client3.json")
resp <- upload_txt(file)
resp
download_as_list(resp, pattern = "stdout")
}