1\name{url.exists} 2\alias{url.exists} 3\title{Check if URL exists} 4\description{ 5 This functions is analogous to \code{\link[base]{file.exists}} 6 and determines whether a request for a specific URL responds 7 without error. We make the request but ask the server 8 not to return the body. We just process the header. 9} 10\usage{ 11url.exists(url, ..., .opts = list(...), 12 curl = getCurlHandle(.opts = .opts), 13 .header = FALSE) 14} 15\arguments{ 16 \item{url}{a vector of one or more URLs whose existence we are to test} 17 \item{\dots}{name = value pairs of Curl options.} 18 \item{.opts}{a list of name = value pairs of Curl options.} 19 \item{curl}{a Curl handle that the caller can specify if she wants to 20 reuse an existing handle, e.g. with different options already 21 specified or that has previously established a connection to the Web 22 server} 23 \item{.header}{a logical value that if \code{TRUE} causes the header 24 information to be returned. 25 } 26} 27\details{ 28 This makes an HTTP request but with the nobody option set to 29 \code{FALSE} so that we don't actually retrieve the contents of the URL. 30} 31\value{ 32 If \code{.header} is \code{FALSE}, this returns 33 \code{TRUE} or \code{FALSE} for each URL indicating whether 34 the request was successful (had a status with a value 35 in the 200 range). 36 37 If \code{.header} is \code{TRUE}, the header is returned for the 38 request for each URL. 39} 40\references{ 41 HTTP specification 42} 43\author{ 44Duncan Temple Lang 45} 46\seealso{ 47 \code{\link{curlPerform}} 48} 49\examples{ 50 url.exists("http://www.omegahat.net/RCurl") 51 try(url.exists("http://www.omegahat.net/RCurl-xxx")) 52} 53 54