Create a client object for interacting with the Metabolomics Workbench
REST API.
The client handles configuration for base URL, caching, and request
timeouts.
Usage
mw_rest_client(
base_url = "https://www.metabolomicsworkbench.org/rest",
cache = FALSE,
cache_dir = tempdir(),
timeout = 30
)
Arguments
- base_url
Character. Base URL for the API (defaults to production
endpoint)
- cache
Logical. Should responses be cached? (default: FALSE)
- cache_dir
Character. Directory for cached responses (default:
tempdir())
- timeout
Numeric. Request timeout in seconds (default: 30)
Value
An S3 object of class "mw_rest_client"
Examples
if (FALSE) { # \dontrun{
# Create a client with default settings
client <- mw_rest_client()
# Create a client with caching enabled
client <- mw_rest_client(cache = TRUE)
# Create a client with custom timeout
client <- mw_rest_client(timeout = 60)
} # }