curl_options {curl}R Documentation

Listing curl features and options

Description

The functions curl_version() and curl_options() show the available features, protocols and options supported by the local version of libcurl.

You can use curl_options_table() to lookup the type for each option: most options take a string, number, or TRUE/FALSE value, but some options need a special enum/bitmask value: these are listed in the sections below.

Usage

curl_options(filter = "")

curl_options_table(filter = "")

curl_version()

Arguments

filter

string: only return options with string in name

Details

Several curl options take an enum or bitmask value, for which the libcurl manual pages give symbolic names. These constants are exported as R variables, so you can copy such values literally from the libcurl documentation:

h <- new_handle()
handle_setopt(h, http_version = CURL_HTTP_VERSION_1_1)
handle_setopt(h, httpauth = CURLAUTH_NEGOTIATE)

For bitmask options, each constant is a single distinct bit, so where the libcurl documentation combines flags with |, you can simply add them up:

handle_setopt(h, httpauth = CURLAUTH_BASIC + CURLAUTH_DIGEST)
handle_setopt(h, altsvc_ctrl = CURLALTSVC_H1 + CURLALTSVC_H2)

Note that a few wide bitmasks such as CURLAUTH_ANY exceed the range of R integers and are therefore stored as doubles, holding the exact same numeric value as their C counterparts.

The sections below list the supported options with their values, in the same order as the corresponding libcurl manual pages. As usual with handle_setopt(), the R option name is the CURLOPT_ constant, lowercase and without the prefix, e.g. CURLOPT_HTTPAUTH becomes httpauth.

CURLOPT_ALTSVC_CTRL

Bitmask to enable Alt-Svc support, see https://curl.se/libcurl/c/CURLOPT_ALTSVC_CTRL.html.

CURLOPT_FOLLOWLOCATION

In addition to classic TRUE/FALSE, libcurl >= 8.13 supports these modes, see https://curl.se/libcurl/c/CURLOPT_FOLLOWLOCATION.html.

CURLOPT_FTP_CREATE_MISSING_DIRS

See https://curl.se/libcurl/c/CURLOPT_FTP_CREATE_MISSING_DIRS.html.

CURLOPT_FTP_FILEMETHOD

Select how to reach a file on an FTP(S) server, see https://curl.se/libcurl/c/CURLOPT_FTP_FILEMETHOD.html.

CURLOPT_FTP_SSL_CCC

Clear Command Channel mode, see https://curl.se/libcurl/c/CURLOPT_FTP_SSL_CCC.html.

CURLOPT_FTPSSLAUTH

Order in which to attempt TLS vs SSL when upgrading an FTP connection, see https://curl.se/libcurl/c/CURLOPT_FTPSSLAUTH.html.

CURLOPT_GSSAPI_DELEGATION

See https://curl.se/libcurl/c/CURLOPT_GSSAPI_DELEGATION.html.

CURLOPT_HEADEROPT

How to send custom headers to a proxy, see https://curl.se/libcurl/c/CURLOPT_HEADEROPT.html.

CURLOPT_HSTS_CTRL

Bitmask to enable HSTS (HTTP Strict Transport Security), see https://curl.se/libcurl/c/CURLOPT_HSTS_CTRL.html.

CURLOPT_HTTP_VERSION

Preferred HTTP protocol version, see https://curl.se/libcurl/c/CURLOPT_HTTP_VERSION.html.

CURLOPT_HTTPAUTH

Bitmask of HTTP authentication methods libcurl may use, see https://curl.se/libcurl/c/CURLOPT_HTTPAUTH.html. The same values apply to proxyauth (CURLOPT_PROXYAUTH).

CURLOPT_IPRESOLVE

See https://curl.se/libcurl/c/CURLOPT_IPRESOLVE.html.

CURLOPT_MIME_OPTIONS

See https://curl.se/libcurl/c/CURLOPT_MIME_OPTIONS.html.

CURLOPT_NETRC

Whether to read credentials from the .netrc file, see https://curl.se/libcurl/c/CURLOPT_NETRC.html.

CURLOPT_POSTREDIR

Bitmask of redirect codes after which a POST must remain a POST, see https://curl.se/libcurl/c/CURLOPT_POSTREDIR.html.

CURLOPT_PROXYTYPE

Type of the proxy set with proxy, see https://curl.se/libcurl/c/CURLOPT_PROXYTYPE.html.

CURLOPT_SOCKS5_AUTH

Bitmask of allowed methods for SOCKS5 proxy authentication, see https://curl.se/libcurl/c/CURLOPT_SOCKS5_AUTH.html: CURLAUTH_BASIC (username/password), CURLAUTH_GSSAPI and CURLAUTH_NONE.

CURLOPT_SSH_AUTH_TYPES

Bitmask of authentication types for SFTP/SCP connections, see https://curl.se/libcurl/c/CURLOPT_SSH_AUTH_TYPES.html.

CURLOPT_SSL_OPTIONS

Bitmask of SSL behavior options, see https://curl.se/libcurl/c/CURLOPT_SSL_OPTIONS.html. The same values apply to proxy_ssl_options (CURLOPT_PROXY_SSL_OPTIONS).

CURLOPT_SSLVERSION

Preferred TLS/SSL version, see https://curl.se/libcurl/c/CURLOPT_SSLVERSION.html. The same values apply to proxy_sslversion (CURLOPT_PROXY_SSLVERSION).

The maximum TLS version can be set by adding one of these to the value above, e.g. CURL_SSLVERSION_TLSv1_1 + CURL_SSLVERSION_MAX_TLSv1_2:

CURLOPT_TIMECONDITION

How to compare the timevalue timestamp, see https://curl.se/libcurl/c/CURLOPT_TIMECONDITION.html.

CURLOPT_USE_SSL

Request TLS upgrade for FTP, SMTP, POP3 and IMAP transfers, see https://curl.se/libcurl/c/CURLOPT_USE_SSL.html.

CURLOPT_WS_OPTIONS

Bitmask with websocket behavior options, see https://curl.se/libcurl/c/CURLOPT_WS_OPTIONS.html.

Other symbols

The sections above cover the option values supported by handle_setopt(). Use curl_symbols() was previously used to lookup the value of any symbol from the libcurl symbol table, along with the libcurl version in which it was introduced, deprecated, or removed.

See Also

handle_setopt()

Examples

# Available options
curl_options()

# List proxy options
curl_options("proxy")
# Curl/ssl version info
curl_version()
# Set options using symbolic constants
h <- new_handle()
handle_setopt(h, http_version = CURL_HTTP_VERSION_1_1)
handle_setopt(h, httpauth = CURLAUTH_BASIC + CURLAUTH_DIGEST)


[Package curl version 8.0.0 Index]