how to download csv file using web-API in R?

0

I am trying to download the CSV file from the link report-link(full_l). when I pass this URL into GET() function get.data <- GET(url = full_l) names(get.data). It gives a below error:

Error in curl::curl_fetch_memory(url, handle = handle) : schannel: next InitializeSecurityContext failed: SEC_E_UNTRUSTED_ROOT (0x80090325) - The certificate chain was issued by an authority that is not trusted.

Help me to resolve and how can I download this CSV file?

If I bypass SSL certificate by httr::set_config(config(ssl_verifypeer = 0L, ssl_verifyhost = 0L))

Another way i tried:

require(downloader) options(download.file.method="libcurl") if (!file.exists("data")) { dir.create("data") } download.file(full_l, "data/Inventory.csv")

CSV File gets downloaded but it has HTML content of login page.

How to download the file with the required content?

r
api
csv
https
download
asked on Stack Overflow Dec 26, 2018 by Bhavneet sharma • edited Dec 26, 2018 by Bhavneet sharma

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0