R/getBridgeURL.R

## FUNCTION THAT WILL CHECK ALL CALLS FOR FAILURES AND CONVERT JSON RESPONSES
#####

.getBridgeURL <- function(url, .opts=.getBridgeCache('opts'), httpheader=.getBridgeCache("httpheader"), ...){
  
  h <- basicHeaderGatherer()
  tryGetURL <- getURL(url, .opts=.opts,
                      httpheader=httpheader, headerfunction = h$update, ...)
  
  st <- h$value()["status"]
  if(st != "201"){
    tryGetURL <- fromJSON(tryGetURL)
  }
  
  return(tryGetURL)
}
brian-bot/bridger documentation built on May 13, 2019, 5:11 a.m.