R/set_algaebase_apikey_header.r

Defines functions set_algaebase_apikey_header

Documented in set_algaebase_apikey_header

#' Add algaebase API key to curl handle
#' @param apikey character string with valid key 
#'
#' @export set_algaebase_apikey_header
#'
#' @return curl handle object
set_algaebase_apikey_header<-function(apikey=NULL)
{
  if(is.null(apikey)){
    stop("You must have a valid API key for www.algaebase.org")
  }
  h <- curl::new_handle(verbose = TRUE)
  curl::handle_setheaders(h,
                    "Content-Type" = "application/json",
                    "abapikey" = apikey)
  return(h)
}

Try the algaeClassify package in your browser

Any scripts or data that you put into this service are public.

algaeClassify documentation built on Nov. 22, 2023, 1:08 a.m.