File: getCurlHandle.Rd

package info (click to toggle)
r-cran-rcurl 1.95-4.8-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,140 kB
  • ctags: 515
  • sloc: ansic: 3,135; xml: 1,734; asm: 993; sh: 12; makefile: 2
file content (80 lines) | stat: -rw-r--r-- 3,046 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
\name{getCurlHandle}
\alias{getCurlHandle}
\alias{getCurlMultiHandle}
\alias{dupCurlHandle}
\title{Create libcurl handles}
\description{
  These functions create and duplicate curl handles
  for use in calls to the HTTP facilities provided by
  that low-level language and this R-level interface.
  A curl handle is an opaque data type that contains a
  reference to the internal C-level data structure
  of libcurl for performing HTTP requests.

  The \code{getCurlMutliHandle} returns an object
  that can be used for concurrent, multiple requests.
  It is quite different from the regular curl handle
  and again, should be treated as an opaque data type.
}
\usage{
getCurlHandle(..., .opts = NULL, .encoding = integer(),
              .defaults = getOption("RCurlOptions"))
dupCurlHandle(curl, ..., .opts = NULL, .encoding = integer())
getCurlMultiHandle(..., .handles = list(...))
}
\arguments{
  \item{curl}{the existing curl handle that is to be duplicated}
  \item{...}{a named list of curl options to set after the handle has
    been created. For \code{getCurlMultiHandle}, these values are
    invidivual curl handle objects, created via \code{getCurlHandle} or \code{dupCurlHandle}. }
  \item{.opts}{a named list or \code{CURLOptions} object identifying the
    curl options for the handle. These and the \code{...} arguments are
    used after the handle has been created.}
  \item{.encoding}{an integer or a string that explicitly identifies the
    encoding of the content that is returned by the HTTP server in its
    response to our query. The possible strings are
    \sQuote{UTF-8} or \sQuote{ISO-8859-1}
    and the integers should be specified symbolically
    as  \code{CE_UTF8} and \code{CE_LATIN1}.
    Note that, by default, the package attempts to process the header of
    the HTTP response to determine the encoding. This argument is used
    when such information is erroneous and the caller knows the correct
    encoding.
  }
  \item{.defaults}{a collection of default values taken from R's
    global/session options. This is a parameter so that one can override
    it if necessary.}
  \item{.handles}{a list of curl handle objects that are used as the
    individual request handles within the multi-asynchronous requests}
}
\details{
  These functions create C-level data structures.
}
\value{
  An object of class \code{CURLHandle}
  which is simply a pointer to the memory for the C
  structure.
}
\references{Curl homepage \url{http://curl.haxx.se}}
\author{Duncan Temple Lang <duncan@wald.ucdavis.edu>}


\seealso{
  \code{\link{getURL}}
  \code{\link{curlPerform}}
}
\examples{

  options(RCurlOptions = list(verbose = TRUE,
                              followlocation = TRUE,
                              autoreferer = TRUE,
                              nosignal = TRUE))
  if(url.exists("http://www.omegahat.net/RCurl")) {
     x = getURL("http://www.omegahat.net/RCurl")
        # here we override one of these.
     x = getURL("http://www.omegahat.net/RCurl", verbose = FALSE)
  }
}
\keyword{IO}