test_connection: Test for internet connection, timeout and status

View source: R/http_funs.R

test_connectionR Documentation

Test for internet connection, timeout and status

Description

Constructs a function for trying an URL

Usage

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


rOpenGov/sotkanet documentation built on March 29, 2022, 6:46 p.m.