o311_ok {r311} | R Documentation |
Is open311 API ok?
Description
Checks whether an open311 API mounted by o311_api
is reachable
and returns a valid requests response.
Usage
o311_ok(error = FALSE)
Arguments
error |
Whether to return a logical or the error message describing why the API is not ok. |
Value
A logical describing whether the API is reachable or not.
If error = TRUE
, returns the corresponding error object if one
occurs.
Examples
# check if Bonn API is reachable
o311_api("Bonn")
o311_ok()
# check if Helsinki API is reachable - fails
o311_add_endpoint(
name = "Helsinki",
root = "asiointi.hel.fi/palautews/rest/v1/"
)
o311_api("Helsinki")
o311_ok()
# return error message
try(o311_ok(error = TRUE))
# reset endpoints database
o311_reset_endpoints()
[Package r311 version 0.3.7 Index]