http_head | R Documentation |
An async HTTP deferred object is also an event emitter, see
http_get()
for details, and also event_emitter.
http_head(
url,
headers = character(),
file = NULL,
options = list(),
on_progress = NULL
)
url |
URL to connect to. |
headers |
HTTP headers to send. |
file |
If not |
options |
Options to set on the handle. Passed to
|
on_progress |
Progress handler function. It is only used if the response body is written to a file. See details below. |
Deferred object.
Other asyncronous HTTP calls:
http_get()
,
http_setopt()
afun <- async(function() {
dx <- http_head("https://eu.httpbin.org/status/200")$
then(function(x) x$status_code)
})
synchronise(afun())
# Check a list of URLs in parallel
afun <- function(urls) {
when_all(.list = lapply(urls, http_head))$
then(function(x) lapply(x, "[[", "status_code"))
}
urls <- c("https://google.com", "https://eu.httpbin.org")
synchronise(afun(urls))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.