Send an API request (basically a wrapper to httr:GET that adds a marker for the data item)

send_request(request, config_options = list())

Arguments

request

list; a named list with at least a url to be sent and the data item contained within (most easily generated from build_call())

config_options

list; a named list of config options to be passed to httr::GET

Value

A response() object with an added data_item attribute

Examples

send_request( build_call(data_item = "TEMP", from_date = "01 Jun 2019", to_date = "10 Jun 2019", api_key = "test") )
#> Response [https://api.bmreports.com/BMRS/TEMP/v1?APIKey=test&FromDate=2019-06-01&ToDate=2019-06-10&ServiceType=csv] #> Date: 2021-06-07 20:01 #> Status: 200 #> Content-Type: text/xml;charset=UTF-8 #> Size: 294 B #>