
Utility function to retrieve data from the Water Quality Portal with retry
Source:R/util_importwqp.R
util_importwqp.RdUtility function to retrieve data from the Water Quality Portal with retry
Arguments
- url
chr string for the Water Quality Portal API endpoint to query
- headers
named chr vector of HTTP headers to pass to
httr::POST- body
named list of the JSON request body to pass to
httr::POST- max_retries
integer indicating maximum number of retries on request failure (default = 5)
- trace
logical indicating whether to print retry messages, default
TRUE
Details
Used internally with read_importwqp. Retries with exponential backoff on any request or parsing failure (e.g., an empty or malformed response from an intermittent API failure), since such failures are not reliably identifiable by error message alone.