View source: R/check_api_access.R
check_api_access | R Documentation |
Tests whether R can access resources at Statistics Finland's geoserver APIs, specifically the WFS (Web Feature Service) or OGC API. This internal function is used to verify connectivity before making API requests.
check_api_access(which_api = "statfi_wfs")
which_api |
Character. The API to check. Must be one of:
|
This function sends a lightweight HTTP request to the specified API endpoint
to check for accessibility. It uses httr2
for robust HTTP handling and
retries transient network failures up to 3 times. The function is intended for
internal use within the package to ensure API connectivity before executing
data retrieval operations.
Logical. Returns TRUE
if the API is accessible (HTTP status 200),
FALSE
otherwise. Issues a warning if the request fails due to network
issues or non-200 status codes.
Markus Kainu markus.kainu@kapsi.fi
## Not run:
check_api_access() # Check WFS API
check_api_access("statfi_ogc") # Check OGC API
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.