| 1 |
\name{reset} |
| 2 |
\alias{reset} |
| 3 |
\alias{reset,CURLHandle-method} |
| 4 |
\title{Generic function for resetting an object} |
| 5 |
\description{ |
| 6 |
This generic and the associated method for a CURLHandle |
| 7 |
allows one to reset the state of the Curl object |
| 8 |
to its default state. This is convenient if we want |
| 9 |
to reuse the same connection, but want to ensure |
| 10 |
that it is in a particular state. |
| 11 |
|
| 12 |
Unfortunately, we cannot query the state of different |
| 13 |
fields in an existing Curl handle and so we need |
| 14 |
to be able to reset the state and then update it with |
| 15 |
any particular settings we would have liked to keep. |
| 16 |
} |
| 17 |
\usage{ |
| 18 |
reset(x, ...) |
| 19 |
} |
| 20 |
\arguments{ |
| 21 |
\item{x}{the object to be reset. For our method, this is an object of |
| 22 |
class \code{CURLHandle}.} |
| 23 |
\item{\dots}{additional arguments for methods} |
| 24 |
} |
| 25 |
\details{ |
| 26 |
This calls the C routine \code{curl_easy_reset} in libcurl. |
| 27 |
} |
| 28 |
\value{ |
| 29 |
Methods typically return the updated version of the |
| 30 |
object passed to it. This allows the caller to assign |
| 31 |
the new result to the same variable rather than |
| 32 |
relying on mutating the content of the object in place. |
| 33 |
In other words, the object should not be treated as a reference |
| 34 |
but a new object with the updated contents should be returned. |
| 35 |
} |
| 36 |
\references{Curl homepage \url{https://curl.se/}} |
| 37 |
\author{Duncan Temple Lang} |
| 38 |
\seealso{ |
| 39 |
\code{\link{getCurlHandle}} |
| 40 |
\code{\link{dupCurlHandle}} |
| 41 |
} |
| 42 |
\examples{ |
| 43 |
h = getCurlHandle() |
| 44 |
curlSetOpt(customrequest = "DELETE") |
| 45 |
reset(h) |
| 46 |
} |
| 47 |
\keyword{programming} |
| 48 |
|