R/sag_post.R

Defines functions sag_post

Documented in sag_post

#' Post to a url
#'
#' Post to a url using an ICES authentication token
#'
#' @param url the url to get.
#' @param body a list of named arguments to be sent as the body of the
#'   post request.
#' @param verbose should verbose output form the http request be
#'   returned? default FALSE.
#'
#' @return content of the http response.
#'
#' @seealso
#' \code{\link{sag_api}} builds a SAG web service url.
#'
#' \code{\link{icesSAG-package}} gives an overview of the package.
#'
#' @export
#'
#' @importFrom icesConnect ices_post
sag_post <- function(url, body = list(), verbose = FALSE) {
  out <- ices_post(url, body, retry = TRUE, verbose = verbose, content = TRUE, use_token = TRUE, encode = "json")

  return(out)
}

Try the icesSAG package in your browser

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

icesSAG documentation built on June 8, 2025, 10:29 a.m.