test_connection: Test for internet connection, timeout and status

Description Usage Arguments Value Author(s) Source

View source: R/http_funs.R

Description

Constructs a function for trying an URL

Usage

1
test_connection(url = NULL, timeout = 10)

Arguments

url

URL to query

timeout

Timeout time in seconds.

Value

HTTP response or a conditionMessage

Author(s)

Pyry Kantanen (maintainer), Kostas Vasilopoulos

Source

Gracefully failing HTTP request code (slightly adapted by Pyry Kantanen) from RStudio community member kvasilopoulos. Many thanks!

Source of the original RStudio community discussion: https://community.rstudio.com/t/internet-resources-should-fail-gracefully/49199


sotkanet documentation built on Feb. 2, 2022, 1:07 a.m.