R/user-agent.r

Defines functions user_agent

Documented in user_agent

#' Set user agent.
#'
#' Override the default RCurl user agent of `NULL`
#'
#' @param agent string giving user agent
#' @export
#' @family config
#' @examples
#' \dontrun{
#' GET("http://httpbin.org/user-agent")
#' GET("http://httpbin.org/user-agent", user_agent("httr"))
#' }
user_agent <- function(agent) {
  stopifnot(is.character(agent), length(agent) == 1)

  config(useragent = agent)
}

Try the httr package in your browser

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

httr documentation built on Aug. 15, 2023, 9:08 a.m.