Handling API Calls
API_GET.RdSmall helper function to handle http requests to the API.
Arguments
- URL
the URL to be called.
- config
NULLorlist, forwarded tohttr::GET.- query
NULLorlist, forwarded tohttr::GET.- expected_class
NULLor character vector. If set, it is checked if the returned object is of this class. If not, a warning will be thrown (no error).- verbose
logical, shows some additional information if
TRUE.
Value
Returns the object we get from httr::content() after a successful
API call. If an error is detected, an error with additional details will be displayed.