
This handle preserves settings and cookies across multiple requests. It is the foundation of all requests performed through the httr package, although it will mostly be hidden from the user.
handle(url, cookies = TRUE)
full url to site
DEPRECATED
# NOT RUN {
handle("http://google.com")
handle("https://google.com")
h <- handle("http://google.com")
GET(handle = h)
# Should see cookies sent back to server
GET(handle = h, config = verbose())
h <- handle("http://google.com", cookies = FALSE)
GET(handle = h)$cookies
# }
# NOT RUN {
# Using the preferred way of configuring the http methods
# will not work when using handle():
GET(handle = h, timeout(10))
# Passing named arguments will work properly:
GET(handle = h, config = list(timeout(10), add_headers(Accept = "")))
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab