curl and the cli curl both rely on libcurl
suppressWarnings(suppressMessages(library(curl)))
req <- curl_fetch_memory("https://eu.httpbin.org/get?foo=123")
str(req)
#> List of 7
#> $ url : chr "https://eu.httpbin.org/get?foo=123"
#> $ status_code: int 200
#> $ type : chr "application/json"
#> $ headers : raw [1:202] 48 54 54 50 ...
#> $ modified : POSIXct[1:1], format: NA
#> $ times : Named num [1:6] 0 0.0294 0.12 0.4432 0.5957 ...
#> ..- attr(*, "names")= chr [1:6] "redirect" "namelookup" "connect" "pretransfer" ...
#> $ content : raw [1:370] 7b 0a 20 20 ...
Created on 2020-09-26 by the reprex package (v0.3.0.9001)