Skip to contents

Ping a CKAN server to test if it is up or down.

Usage

ping(url = get_default_url(), key = get_default_key(), as = "logical", ...)

Arguments

url

Base URL to use. Default: https://demo.ckan.org/. See also ckanr_setup and get_default_url.

key

A privileged CKAN API key. Default: your key set with ckanr_setup

as

(character) One of "logical" (default) or "json". With as = "logical" failures return FALSE. With as = "json" failures signal an error instead of returning a non-JSON logical.

...

Extra curl arguments. The function passes them to verb-POST (optional)

Value

(logical) TRUE when the CKAN server is up, FALSE when it is down. With as = "json", the raw JSON response string instead.

Examples

if (FALSE) { # \dontrun{
ping()
ping(as = "json")
} # }