Retrieve the headers for a URL for a supported protocol such as http://, ftp://, https:// and ftps://. An optional function not supported on all platforms.
curlGetHeaders(url, redirect = TRUE, verify = TRUE)
| Parameter | Description |
|---|---|
url |
character string specifying the URL. |
redirect |
logical: should redirections be followed? |
verify |
logical: should certificates be verified as valid and applying to that host? |
# NOT RUN {
## needs Internet access, results vary
curlGetHeaders("http://bugs.r-project.org") ## this redirects to https://
curlGetHeaders("https://httpbin.org/status/404") ## returns status
curlGetHeaders("ftp://cran.r-project.org")
# }
# NOT RUN {
## a not-always-available site:
curlGetHeaders("ftps://test.rebex.net/readme.txt")
# }