Function to wrap aroung httr::POST
, sending the request body to the API.
callTargomoAPI(api_key = Sys.getenv("TARGOMO_API_KEY"),
region = Sys.getenv("TARGOMO_REGION"), service, body,
config = list(), verbose = FALSE, progress = FALSE,
timeout = NULL)
The Targomo API key.
The Targomo region.
The Targomo service - 'polygon', 'route', or 'time'.
A request body made with createRequestBody
.
Config options to pass to httr::POST
e.g. proxy settings
Display info on the API call?
Display a progress bar?
Timeout in seconds (leave NULL for no timeout/curl default).
A httr response object with the API response (whether successful or not).