Set curl options.

Generally you should only need to use this function to set CURL options directly if there isn't already a helpful wrapper function, like set_cookies, add_headers or authenticate. To use this function effectively requires some knowledge of CURL, and CURL options. Use httr_options to see a complete list of available options. To see the libcurl documentation for a given option, use curl_docs.

config(..., token = NULL)

named Curl options.


An OAuth token (1.0 or 2.0)


Unlike Curl (and RCurl), all configuration options are per request, not per handle.

See Also

set_config to set global config defaults, and with_config to temporarily run code with set options.

All known available options are listed in httr_options

Other config: add_headers, authenticate, set_cookies, timeout, use_proxy, user_agent, verbose

Other ways to set configuration: set_config, with_config

  • config
library(httr) # NOT RUN { # There are a number of ways to modify the configuration of a request # * you can add directly to a request HEAD("", verbose()) # * you can wrap with with_config() with_config(verbose(), HEAD("")) # * you can set global with set_config() old <- set_config(verbose()) HEAD("") # and re-establish the previous settings with set_config(old, override = TRUE) HEAD("") # or reset_config() HEAD("") # If available, you should use a friendly httr wrapper over RCurl # options. But you can pass Curl options (as listed in httr_options()) # in config HEAD("", config(verbose = TRUE)) # }
Documentation reproduced from package httr, version 1.2.1, License: MIT + file LICENSE

Community examples

Looks like there are no examples yet.