View source code
Display the source code in etc/c/curl.d from which this page was generated on
github.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.
Requires a signed-in GitHub account. This works well for small changes.
If you'd like to make larger changes you may want to consider using
local clone.
Page wiki
View or edit the community-maintained wiki page associated with this page.
Enum etc.c.curl.CurlOption
The enum base type is
.
int
Enum members
Name | Description |
---|---|
address_scope
|
(IPv6) Address scope |
append
|
Append instead of overwrite on upload !
|
autoreferer
|
We want the referrer field set automatically when following locations |
buffersize
|
Instruct libcurl to use a smaller receive buffer |
cainfo
|
The CApath or CAfile used to validate the peer certificate this option is used only if SSL_VERIFYPEER is true |
capath
|
The CApath directory used to validate the peer certificate this option is used only if SSL_VERIFYPEER is true |
certinfo
|
Collect certificate chain info and allow it to get retrievable with CURLINFO_CERTINFO after the transfer is complete. (Unfortunately) only working with OpenSSL-powered builds. |
chunk_bgn_function
|
Directory matching callback called before downloading of an
individual file (chunk) started
|
chunk_data
|
Let the application define custom chunk data pointer |
chunk_end_function
|
Directory matching callback called after the file (chunk)
was downloaded, or skipped
|
closepolicy
|
What policy to use when closing connections when the cache is filled up |
connecttimeout
|
Time-out connect operations after this amount of seconds, if connects are OK within this time, then fine... This only aborts the connect phase. [Only works on unix-style/SIGALRM operating systems] |
connect_only
|
no transfer, set up connection and let application use the socket by extracting it with CURLINFO_LASTSOCKET |
conv_from_network_function
|
Function that will be called to convert from the
network encoding (instead of using the iconv calls in libcurl)
|
conv_from_utf8_function
|
Function that will be called to convert from UTF8 (instead of using the iconv calls in libcurl) Note that this is used only for SSL certificate processing |
conv_to_network_function
|
Function that will be called to convert to the
network encoding (instead of using the iconv calls in libcurl)
|
cookie
|
Set cookie in request:
|
cookiefile
|
point to a file to read the initial cookies from, also enables
"cookie awareness"
|
cookiejar
|
Specify which file name to write all known cookies in after completed
operation. Set file name to "-" (dash) to make it go to stdout.
|
cookielist
|
feed cookies into cookie engine
|
cookiesession
|
mark this as start of a cookie session
|
copypostfields
|
POST volatile input fields. |
crlf
|
send TYPE parameter? |
crlfile
|
CRL file
|
customrequest
|
35 = OBSOLETE |
debugdata
|
set the data for the debug function |
debugfunction
|
set the debug function |
dirlistonly
|
return bare names when listing directories |
dns_cache_timeout
|
DNS cache timeout
|
dns_use_global_cache
|
Non-zero value means to use the global dns cache |
egdsocket
|
Set to the Entropy Gathering Daemon socket pathname |
encoding
|
Set the Accept-Encoding string. Use this to tell a server you would like the response to be compressed. |
errorbuffer
|
Buffer to receive error messages in, must be at least CURL_ERROR_SIZE
bytes big. If this is not used, error messages go to stderr instead:
|
failonerror
|
no output on http error codes >= 300 |
file
|
This is the FILE * or void * the regular output should be written to. |
filetime
|
Pass a long set to 1 to get the date of the requested document (if possible)! Pass a zero to shut it off. |
fnmatch_data
|
FNMATCH_FUNCTION user pointer |
fnmatch_function
|
Change match (fnmatch-like) callback for wildcard matching |
followlocation
|
use Location: Luke! |
forbid_reuse
|
Set to explicitly forbid the upcoming transfer's connection to be re-used when done. Do not use this unless you're absolutely sure of this, as it makes the operation slower and is less friendly for the network. |
fresh_connect
|
73 = OBSOLETE |
ftpport
|
Set the FTP PORT string (interface name, named or numerical IP address) Use i.e '-' to use default address. |
ftpsslauth
|
122 OBSOLETE, used in 7.12.3. Gone in 7.13.0 |
ftp_account
|
132 OBSOLETE. Gone in 7.16.0 |
ftp_alternative_to_user
|
Pointer to command string to send if USER/PASS fails. |
ftp_create_missing_dirs
|
FTP Option that causes missing dirs to be created on the remote server. In 7.19.4 we introduced the convenience enums for this option using the CURLFTP_CREATE_DIR prefix. |
ftp_filemethod
|
Select "file method" to use when doing FTP, see the curl_ftpmethod
above.
|
ftp_response_timeout
|
FTP option that changes the timeout , in seconds, associated with
getting a response. This is different from transfer timeout time and
essentially places a demand on the FTP server to acknowledge commands
in a timely manner.
|
ftp_skip_pasv_ip
|
Set to non-zero to skip the IP address received in a 227 PASV FTP server response. Typically used for FTP-SSL purposes but is not restricted to that. libcurl will then instead use the same IP address it used for the control connection. |
ftp_ssl_ccc
|
Send CCC (Clear Command Channel) after authentication |
ftp_use_eprt
|
Specifically switch on or off the FTP engine's use of the EPRT command ( it also disables the LPRT attempt). By default, those ones will always be attempted before the good old traditional PORT command. |
ftp_use_epsv
|
Specifically switch on or off the FTP engine's use of the EPSV command. By default, that one will always be attempted before the more traditional PASV command. |
ftp_use_pret
|
|
header
|
throw the header out too
|
headerdata
|
convenient alias |
headerfunction
|
Function that will be called to store headers (instead of fwrite). The parameters will use fwrite() syntax, make sure to follow them. |
http200aliases
|
Set aliases for HTTP 200 in the HTTP Response header
|
httpauth
|
Set this to a bitmask value to enable the particular authentications methods you like. Use this in combination with CURLOPT_USERPWD. Note that setting multiple bits may cause extra network round-trips. |
httpget
|
Set this to force the HTTP request to get back to GET. Only really usable if POST, PUT or a custom request have been used first. |
httpheader
|
This points to a linked list of headers, struct curl_slist kind
|
httppost
|
This points to a linked list of post entries, struct curl_httppost
|
httpproxytunnel
|
tunnel non-http operations through a HTTP proxy
|
http_content_decoding
|
set to zero to disable the libcurl's decoding and thus pass the raw body data to the application even when it is encoded/compressed |
http_transfer_decoding
|
set to zero to disable the libcurl's decoding and thus pass the raw body data to the application even when it is encoded/compressed |
http_version
|
Specify which HTTP version to use! This must be set to one of the CURL_HTTP_VERSION* enums set below. |
ignore_content_length
|
ignore Content-Length |
infile
|
not used |
infilesize
|
If the CURLOPT_INFILE is used, this can be used to inform libcurl about
how large the file being sent really is. That allows better error
checking and better verifies that the upload was successful. -1 means
unknown size.
|
infilesize_large
|
See the comment for INFILESIZE above, but in short, specifies
the size of the file being uploaded. -1 means unknown.
|
interleavedata
|
The stream to pass to INTERLEAVEFUNCTION. |
interleavefunction
|
Let the application define a custom write method for RTP data |
intrface
|
Set the interface string to use as outgoing network interface |
ioctldata
|
|
ioctlfunction
|
|
ipresolve
|
Set this option to one of the CURL_IPRESOLVE_* defines (see below) to
tell libcurl to resolve names to those IP versions only. This only has
affect on systems with support for more than one, i.e IPv4 and_ IPv6.
|
issuercert
|
Issuer certificate |
keypasswd
|
password for the SSL or SSH private key
|
krblevel
|
Set the krb4/5 security level, this also enables krb4/5 awareness. This is a string, 'clear', 'safe', 'confidential' or 'private'. If the string is set but doesn't match one of these, 'private' will be used. |
lastentry
|
the last unused |
localport
|
Local port number to bind the socket to
|
localportrange
|
Number of ports to try, including the first one set with LOCALPORT. Thus, setting it to 1 will make no additional attempts but the first. |
low_speed_limit
|
If the download receives less than "low speed limit" bytes/second during "low speed time" seconds, the operations is aborted. You could i.e if you have a pretty high speed connection, abort if it is less than 2000 bytes/sec during 20 seconds. |
low_speed_time
|
Set the "low speed time" |
mail_from
|
set the SMTP mail originator |
mail_rcpt
|
set the SMTP mail receiver(s) |
maxconnects
|
Max amount of cached alive connections |
maxfilesize
|
Set this option to limit the size of a file that will be downloaded from
an HTTP or FTP server.
|
maxfilesize_large
|
Sets the maximum size of data that will be downloaded from
an HTTP or FTP server. See MAXFILESIZE above for the LONG version.
|
maxredirs
|
66 = OBSOLETE |
max_recv_speed_large
|
if the connection proceeds too quickly then need to slow it down |
max_send_speed_large
|
if the connection proceeds too quickly then need to slow it down |
netrc
|
Specify whether to read the user+password from the .netrc or the URL.
This must be one of the CURL_NETRC_* enums below.
|
netrc_file
|
Set this option to the file name of your .netrc file you want libcurl
to parse (using the CURLOPT_NETRC option). If not set, libcurl will do
a poor attempt to find the user's home directory and check for a .netrc
file in there.
|
new_directory_perms
|
Permission used when creating new files and directories on the remote
server for protocols that support it, SFTP/SCP/FILE
|
new_file_perms
|
Permission used when creating new files and directories on the remote
server for protocols that support it, SFTP/SCP/FILE
|
nobody
|
use HEAD to get http document |
noprogress
|
shut off the progress meter |
noproxy
|
Comma separated list of hostnames defining no-proxy zones. These should
match both hostnames directly, and hostnames within a domain. For
example, local.com will match local.com and www.local.com, but NOT
notlocal.com or www.notlocal.com. For compatibility with other
implementations of this, .local.com will be considered to be the same as
local.com. A single * is the only valid wildcard, and effectively
disables the use of proxy .
|
nosignal
|
Instruct libcurl to not use any signal/alarm handlers, even when using timeouts. This option is useful for multi-threaded applications. See libcurl-the-guide for more background information. |
opensocketdata
|
Callback function for opening socket (instead of socket(2)). Optionally,
callback is able change the address or refuse to connect returning
CURL_SOCKET_BAD. The callback should have type
curl_opensocket_callback
|
opensocketfunction
|
Callback function for opening socket (instead of socket(2)). Optionally,
callback is able change the address or refuse to connect returning
CURL_SOCKET_BAD. The callback should have type
curl_opensocket_callback
|
password
|
"name" and "pwd" to use when fetching. |
port
|
Port number to connect to, if other than default. |
post
|
HTTP POST method |
postfields
|
POST static input fields. |
postfieldsize
|
size of the POST input data, if strlen() is not good to use |
postfieldsize_large
|
The LARGE version of the standard POSTFIELDSIZE option |
postquote
|
38 is not used |
postredir
|
Set the behaviour of POST when redirecting. Values must be set to one of CURL_REDIR* defines below. This used to be called CURLOPT_POST301 |
prequote
|
send linked-list of pre-transfer QUOTE commands |
private_opt
|
Set pointer to private data |
progressdata
|
Data passed to the progress callback |
progressfunction
|
55 = OBSOLETE |
protocols
|
set the bitmask for the protocols that are allowed to be used for the
transfer, which thus helps the app which takes URLs from users or other
external inputs and want to restrict what protocol(s) to deal
with. Defaults to CURLPROTO_ALL.
|
proxy
|
Name of proxy to use.
|
proxyauth
|
Set this to a bitmask value to enable the particular authentications methods you like. Use this in combination with CURLOPT_PROXYUSERPWD. Note that setting multiple bits may cause extra network round-trips. |
proxypassword
|
"name" and "pwd" to use with Proxy when fetching. |
proxyport
|
Port of the proxy , can be set in the proxy string as well with:
"[host]:[port ]"
|
proxytype
|
indicates type of proxy . accepted values are CURLPROXY_HTTP (default),
CURLPROXY_SOCKS4, CURLPROXY_SOCKS4A and CURLPROXY_SOCKS5.
|
proxyusername
|
"name" and "pwd" to use with Proxy when fetching. |
proxyuserpwd
|
"name:password " to use with proxy .
|
proxy_transfer_mode
|
set transfer mode (;type=) when doing FTP via an HTTP proxy
|
put
|
HTTP PUT |
quote
|
send linked-list of QUOTE commands |
random_file
|
Set to a file name that contains random data for libcurl to use to
seed the random engine when doing SSL connects.
|
range
|
Range to get, specified as an ASCII string. |
readdata
|
convenient alias |
readfunction
|
Function that will be called to read the input (instead of fread). The parameters will use fread() syntax, make sure to follow them. |
redir_protocols
|
set the bitmask for the protocols that libcurl is allowed to follow to,
as a subset of the CURLOPT_PROTOCOLS ones. That means the protocol needs
to be set in both bitmasks to be allowed to get redirected to. Defaults
to all protocols except FILE and SCP.
|
referer
|
Set the referrer page (needed by some CGIs) |
resolve
|
send linked-list of name:port :address sets
|
resume_from
|
Set the continuation offset. |
resume_from_large
|
Sets the continuation offset. There is also a LONG version of this;
look above for RESUME_FROM.
|
rtspheader
|
convenient alias |
rtsp_client_cseq
|
Manually initialize the client RTSP CSeq for this handle |
rtsp_request
|
RTSP request method (OPTIONS, SETUP, PLAY, etc...) |
rtsp_server_cseq
|
Manually initialize the server RTSP CSeq for this handle |
rtsp_session_id
|
The RTSP session identifier |
rtsp_stream_uri
|
The RTSP stream URI |
rtsp_transport
|
The Transport: header to use in RTSP requests
|
seekdata
|
Callback function for seeking in the input stream |
seekfunction
|
Callback function for seeking in the input stream |
share
|
Provide a CURLShare for mutexing non-ts data |
sockoptfunction
|
callback function for setting socket options |
socks5_gssapi_nec
|
Socks Service |
socks5_gssapi_service
|
Socks Service |
ssh_auth_types
|
allowed SSH authentication methods |
ssh_host_public_key_md5
|
used by scp/sftp to verify the host's public key |
ssh_keydata
|
set the SSH host key callback custom pointer |
ssh_keyfunction
|
set the SSH host key callback, must point to a curl_sshkeycallback
function
|
ssh_knownhosts
|
set the SSH knownhost file name to use
|
ssh_public_keyfile
|
Used by scp/sftp to do public/private key authentication |
sslcert
|
name of the file keeping your private SSL-certificate
|
sslcerttype
|
type of the file keeping your SSL-certificate ("DER", "PEM", "ENG")
|
sslengine
|
crypto engine for the SSL-sub system |
sslengine_default
|
set the crypto engine for the SSL-sub system as default the param has no meaning... |
sslkey
|
name of the file keeping your private SSL-key
|
sslkeytype
|
type of the file keeping your private SSL-key ("DER", "PEM", "ENG")
|
sslversion
|
What version to specifically try to use. See CURL_SSLVERSION defines below. |
ssl_cipher_list
|
Specify which SSL ciphers to use |
ssl_ctx_data
|
Set the userdata for the ssl context callback function's third argument |
ssl_ctx_function
|
Set the ssl context callback function, currently only for OpenSSL ssl_ctx
in second argument. The function must be matching the
curl_ssl_ctx_callback proto.
|
ssl_sessionid_cache
|
set to 0 to disable session ID re-use for this transfer, default is enabled (== 1) |
ssl_verifyhost
|
Set if we should verify the Common name from the peer certificate in ssl handshake, set 1 to check existence, 2 to ensure that it matches the provided hostname. |
ssl_verifypeer
|
Set if we should verify the peer in ssl handshake, set 1 to verify. |
stderr
|
HTTP request, for odd commands like DELETE, TRACE and others |
tcp_nodelay
|
Enable/disable the TCP Nagle algorithm |
telnetoptions
|
This points to a linked list of telnet options |
tftp_blksize
|
block size for TFTP transfers |
timecondition
|
What kind of HTTP time condition to use, see defines |
timeout
|
Time-out the read operation after this amount of seconds |
timeout_ms
|
Same as TIMEOUT and CONNECTTIMEOUT, but with ms resolution |
timevalue
|
Time to use with the above condition. Specified in number of seconds since 1 Jan 1970 |
tlsauth_password
|
Set a password for authenticated TLS
|
tlsauth_type
|
Set authentication type for authenticated TLS |
tlsauth_username
|
Set a username for authenticated TLS
|
transfertext
|
transfer data in text/ASCII format |
unrestricted_auth
|
Continue to send authentication (user+password ) when following locations,
even when hostname changed. This can potentially send off the name
and password to whatever host the server decides.
|
upload
|
this is an upload
|
url
|
The full URL to get/put
|
useragent
|
Set the User-Agent string (examined by some CGIs) |
username
|
"name" and "pwd" to use when fetching. |
userpwd
|
"name:password " to use when fetching.
|
use_ssl
|
Enable SSL/TLS for FTP, pick one of: CURLFTPSSL_TRY - try using SSL, proceed anyway otherwise CURLFTPSSL_CONTROL - SSL for the control connection or fail CURLFTPSSL_ALL - SSL for all communication or fail |
verbose
|
talk a lot |
wildcardmatch
|
Turn on wildcard matching |
writedata
|
convenient alias |
writefunction
|
Function that will be called to store the output (instead of fwrite). The parameters will use fwrite() syntax, make sure to follow them. |
writeheader
|
send FILE * or void * to store headers to, if you use a callback it is simply passed to the callback unmodified |
writeinfo
|
Pass a pointer to string of the output using full variable-replacement as described elsewhere. |