Debian Codegraph @

man/url_destination.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/io.R
3 \name{url_destination}
4 \alias{url_destination}
5 \title{Get the final destination of a URL}
6 \usage{
7 url_destination(x, force = FALSE)
8 }
9 \arguments{
10 \item{x}{A character vector of URLs.}
11
12 \item{force}{By default, the query is cached in the current R session. To
13 bypass the cache, use \code{force = TRUE}.}
14 }
15 \value{
16 The final destination(s). If the URL returns a status code greater
17 than or equal to 400, it will throw an error.
18 }
19 \description{
20 If a URL is redirected, query the new location via \code{\link[=curlGetHeaders]{curlGetHeaders()}},
21 otherwise return the original URL.
22 }
23 \examples{
24 u = "https://cran.r-project.org/package=xfun"
25 url_destination(u) # redirected to canonical URL
26 }