Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

reset

Generic function for resetting an object


Description

This generic and the associated method for a CURLHandle allows one to reset the state of the Curl object to its default state. This is convenient if we want to reuse the same connection, but want to ensure that it is in a particular state.

Unfortunately, we cannot query the state of different fields in an existing Curl handle and so we need to be able to reset the state and then update it with any particular settings we would have liked to keep.

Usage

reset(x, ...)

Arguments

x

the object to be reset. For our method, this is an object of class CURLHandle.

...

additional arguments for methods

Details

This calls the C routine curl_easy_reset in libcurl.

Value

Methods typically return the updated version of the object passed to it. This allows the caller to assign the new result to the same variable rather than relying on mutating the content of the object in place. In other words, the object should not be treated as a reference but a new object with the updated contents should be returned.

Author(s)

Duncan Temple Lang

References

Curl homepage http://curl.haxx.se

See Also

Examples

h = getCurlHandle()
 curlSetOpt(customrequest = "DELETE")
 reset(h)

RCurl

General Network (HTTP/FTP/...) Client Interface for R

v1.98-1.3
BSD_3_clause + file LICENSE
Authors
CRAN Team [ctb, cre] (de facto maintainer since 2013), Duncan Temple Lang [aut] (<https://orcid.org/0000-0003-0159-1546>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.