config

0th

Percentile

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.

Usage
config(...)
Arguments
...
named Curl options.
Details

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: reset_config, set_config; with_config, with_verbose

Aliases
  • config
Examples
# There are a number of ways to modify the configuration of a request
# * you can add directly to a request
HEAD("https://www.google.com", verbose())

# * you can wrap with with_config()
with_config(verbose(), HEAD("https://www.google.com"))

# * you can set global with set_config()
old <- set_config(verbose())
HEAD("https://www.google.com")
# and re-establish the previous settings with
set_config(old, override = TRUE)
HEAD("https://www.google.com")
# or
reset_config()
HEAD("https://www.google.com")

# 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("https://www.google.com/", config(verbose = TRUE))
Documentation reproduced from package httr, version 0.6.1, License: MIT + file LICENSE

Community examples

Looks like there are no examples yet.