Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
16 lines (14 sloc) 375 Bytes
#' Set user agent.
#'
#' Override the default RCurl user agent of `NULL`
#'
#' @param agent string giving user agent
#' @export
#' @family config
#' @examples
#' 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)
}