nc <- ncurl_aio("https://postman-echo.com/get",
response = c("date", "server"),
timeout = 2000L)
call_aio(nc)
nc$status
nc$headers
nc$data
if (interactive() && requireNamespace("promises", quietly = TRUE)) {
library(promises)
p <- as.promise(nc)
print(p)
p2 <- ncurl_aio("https://postman-echo.com/get") %...>% cat
is.promise(p2)
}
Run the code above in your browser using DataLab