# Load in memory
res <- curl_fetch_memory("http://httpbin.org/cookies/set?foo=123&bar=ftw")
res$content
# Save to disk
res <- curl_fetch_disk("http://httpbin.org/stream/10", tempfile())
res$content
readLines(res$content)
# Stream with callback
res <- curl_fetch_stream("http://httpbin.org/stream/20", function(x){
cat(rawToChar(x))
})
Run the code above in your browser using DataLab