R/callthat_api_put.R

Defines functions call_that_api_put.call_that_connection call_that_api_put

Documented in call_that_api_put

#' Submits a PUT command against a REST API
#' @param api_connection A \code{call_that_connection} object
#' @param endpoint The name of the API's endpoint.  Defaults to an empty character vector.
#' @param body The body or query sent to the REST API.
#' @param headers A \code{list} object containing a named list of headers to pass to the API.
#' @param ... Other arguments to pass to the REST API call.
#' @return An \code{httr} \code{request} object
#' @export
call_that_api_put <- function(api_connection, endpoint = "", body = NULL,
                              headers = list(), ...) {
  UseMethod("call_that_api_put")
}

#' @export
call_that_api_put.call_that_connection <- function(api_connection, endpoint = "", body = NULL,
                                                   headers = list(), ...) {
  call_that_api(
    api_connection = api_connection,
    endpoint = endpoint,
    request = body,
    headers = headers,
    action = "PUT",
    ...
  )
}
edgararuiz/callthat documentation built on Dec. 20, 2021, 3:19 a.m.