curl_easy_setopt - set options for a curl easy handle
Name
curl_easy_setopt - set options for a curl easy handle
Synopsis
#include <curl/curl.h> CURLcode curl_easy_setopt(CURL *handle, CURLoption option, parameter);
Description
curl_easy_setopt is used to tell libcurl how to behave. By setting the appropriate options, the application can change libcurl's behavior. All options are set with an option followed by a parameter. That parameter can be a long, a function pointer, an object pointer or a curl_off_t, depending on what the specific option expects. Read this manual carefully as bad input values may cause libcurl to behave badly. You can only set one option in each function call. A typical application uses many curl_easy_setopt calls in the setup phase.
Options set with this function call are valid for all forthcoming transfers performed using this handle. The options are not in any way reset between transfers, so if you want subsequent transfers with different options, you must change them between the transfers. You can optionally reset all options back to internal default with curl_easy_reset.
Strings passed to libcurl as 'char *' arguments, are copied by the library; the string storage associated to the pointer argument may be discarded or reused after curl_easy_setopt returns. The only exception to this rule is really CURLOPT_POSTFIELDS, but the alternative that copies the string CURLOPT_COPYPOSTFIELDS has some usage characteristics you need to read up on. This function does not accept input strings longer than CURL_MAX_INPUT_LENGTH (8 MB).
The order in which the options are set does not matter.
Before version 7.17.0, strings were not copied. Instead the user was forced keep them available until libcurl no longer needed them.
The handle is the return code from a curl_easy_init or curl_easy_duphandle call.
Options
Path to an abstract Unix domain socket. See CURLOPT_ABSTRACT_UNIX_SOCKET
Timeout for waiting for the server's connect back to be accepted. See CURLOPT_ACCEPTTIMEOUT_MS
Accept-Encoding and automatic decompressing data. See CURLOPT_ACCEPT_ENCODING
IPv6 scope for local addresses. See CURLOPT_ADDRESS_SCOPE
Specify the Alt-Svc: cache filename. See CURLOPT_ALTSVC
Enable and configure Alt-Svc: treatment. See CURLOPT_ALTSVC_CTRL
Append to remote file. See CURLOPT_APPEND
Automatically set Referer: header. See CURLOPT_AUTOREFERER
AWS HTTP V4 Signature. See CURLOPT_AWS_SIGV4
Ask for alternate buffer size. See CURLOPT_BUFFERSIZE
CA cert bundle. See CURLOPT_CAINFO
CA cert bundle memory buffer. See CURLOPT_CAINFO_BLOB
Path to CA cert bundle. See CURLOPT_CAPATH
Timeout for CA cache. See CURLOPT_CA_CACHE_TIMEOUT
Extract certificate info. See CURLOPT_CERTINFO
Callback for wildcard download start of chunk. See CURLOPT_CHUNK_BGN_FUNCTION
Data pointer to pass to the chunk callbacks. See CURLOPT_CHUNK_DATA
Callback for wildcard download end of chunk. See CURLOPT_CHUNK_END_FUNCTION
Data pointer to pass to the close socket callback. See CURLOPT_CLOSESOCKETDATA
Callback for closing socket. See CURLOPT_CLOSESOCKETFUNCTION
Timeout for the connection phase. See CURLOPT_CONNECTTIMEOUT
Millisecond timeout for the connection phase. See CURLOPT_CONNECTTIMEOUT_MS
Only connect, nothing else. See CURLOPT_CONNECT_ONLY
Connect to a specific host and port. See CURLOPT_CONNECT_TO
CURLOPT_CONV_FROM_NETWORK_FUNCTION
OBSOLETE Callback for code base conversion. See CURLOPT_CONV_FROM_NETWORK_FUNCTION
CURLOPT_CONV_FROM_UTF8_FUNCTION
OBSOLETE Callback for code base conversion. See CURLOPT_CONV_FROM_UTF8_FUNCTION
CURLOPT_CONV_TO_NETWORK_FUNCTION
OBSOLETE Callback for code base conversion. See CURLOPT_CONV_TO_NETWORK_FUNCTION
Cookie(s) to send. See CURLOPT_COOKIE
File to read cookies from. See CURLOPT_COOKIEFILE
File to write cookies to. See CURLOPT_COOKIEJAR
Add or control cookies. See CURLOPT_COOKIELIST
Start a new cookie session. See CURLOPT_COOKIESESSION
Send a POST with this data - and copy it. See CURLOPT_COPYPOSTFIELDS
Convert newlines. See CURLOPT_CRLF
Certificate Revocation List. See CURLOPT_CRLFILE
Set URL to work on with a URL handle. See CURLOPT_CURLU
Custom request/method. See CURLOPT_CUSTOMREQUEST
Data pointer to pass to the debug callback. See CURLOPT_DEBUGDATA
Callback for debug information. See CURLOPT_DEBUGFUNCTION
Default protocol. See CURLOPT_DEFAULT_PROTOCOL
List only. See CURLOPT_DIRLISTONLY
CURLOPT_DISALLOW_USERNAME_IN_URL
Do not allow username in URL. See CURLOPT_DISALLOW_USERNAME_IN_URL
Timeout for DNS cache. See CURLOPT_DNS_CACHE_TIMEOUT
Bind name resolves to this interface. See CURLOPT_DNS_INTERFACE
Bind name resolves to this IP4 address. See CURLOPT_DNS_LOCAL_IP4
Bind name resolves to this IP6 address. See CURLOPT_DNS_LOCAL_IP6
Preferred DNS servers. See CURLOPT_DNS_SERVERS
Shuffle addresses before use. See CURLOPT_DNS_SHUFFLE_ADDRESSES
OBSOLETE Enable global DNS cache. See CURLOPT_DNS_USE_GLOBAL_CACHE
Verify the hostname in the DoH (DNS-over-HTTPS) SSL certificate. See CURLOPT_DOH_SSL_VERIFYHOST
Verify the DoH (DNS-over-HTTPS) SSL certificate. See CURLOPT_DOH_SSL_VERIFYPEER
Verify the DoH (DNS-over-HTTPS) SSL certificate's status. See CURLOPT_DOH_SSL_VERIFYSTATUS
Use this DoH server for name resolves. See CURLOPT_DOH_URL
Set the configuration for ECH. See CURLOPT_ECH
OBSOLETE Identify EGD socket for entropy. See CURLOPT_EGDSOCKET
Error message buffer. See CURLOPT_ERRORBUFFER
100-continue timeout. See CURLOPT_EXPECT_100_TIMEOUT_MS
Fail on HTTP 4xx errors. CURLOPT_FAILONERROR
Request file modification date and time. See CURLOPT_FILETIME
Data pointer to pass to the wildcard matching callback. See CURLOPT_FNMATCH_DATA
Callback for wildcard matching. See CURLOPT_FNMATCH_FUNCTION
Follow HTTP redirects. See CURLOPT_FOLLOWLOCATION
Prevent subsequent connections from reusing this. See CURLOPT_FORBID_REUSE
Use a new connection. CURLOPT_FRESH_CONNECT
Use active FTP. See CURLOPT_FTPPORT
Control how to do TLS. See CURLOPT_FTPSSLAUTH
Send ACCT command. See CURLOPT_FTP_ACCOUNT
CURLOPT_FTP_ALTERNATIVE_TO_USER
Alternative to USER. See CURLOPT_FTP_ALTERNATIVE_TO_USER
CURLOPT_FTP_CREATE_MISSING_DIRS
Create missing directories on the remote server. See CURLOPT_FTP_CREATE_MISSING_DIRS
Specify how to reach files. See CURLOPT_FTP_FILEMETHOD
Ignore the IP address in the PASV response. See CURLOPT_FTP_SKIP_PASV_IP
Back to non-TLS again after authentication. See CURLOPT_FTP_SSL_CCC
Use EPRT. See CURLOPT_FTP_USE_EPRT
Use EPSV. See CURLOPT_FTP_USE_EPSV
Use PRET. See CURLOPT_FTP_USE_PRET
Disable GSS-API delegation. See CURLOPT_GSSAPI_DELEGATION
CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS
Timeout for happy eyeballs. See CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS
Send an HAProxy PROXY protocol v1 header. See CURLOPT_HAPROXYPROTOCOL
Spoof the client IP in an HAProxy PROXY protocol v1 header. See CURLOPT_HAPROXY_CLIENT_IP
Include the header in the body output. See CURLOPT_HEADER
Data pointer to pass to the header callback. See CURLOPT_HEADERDATA
Callback for writing received headers. See CURLOPT_HEADERFUNCTION
Control custom headers. See CURLOPT_HEADEROPT
Set HSTS cache file. See CURLOPT_HSTS
Pass pointer to the HSTS read callback. See CURLOPT_HSTSREADDATA
Set HSTS read callback. See CURLOPT_HSTSREADFUNCTION
Pass pointer to the HSTS write callback. See CURLOPT_HSTSWRITEDATA
Set HSTS write callback. See CURLOPT_HSTSWRITEFUNCTION
Enable HSTS. See CURLOPT_HSTS_CTRL
Allow HTTP/0.9 responses. CURLOPT_HTTP09_ALLOWED
Alternative versions of 200 OK. See CURLOPT_HTTP200ALIASES
HTTP server authentication methods. See CURLOPT_HTTPAUTH
Do an HTTP GET request. See CURLOPT_HTTPGET
Custom HTTP headers. See CURLOPT_HTTPHEADER
Deprecated option Multipart formpost HTTP POST. See CURLOPT_HTTPPOST
Tunnel through the HTTP proxy. CURLOPT_HTTPPROXYTUNNEL
Disable Content decoding. See CURLOPT_HTTP_CONTENT_DECODING
CURLOPT_HTTP_TRANSFER_DECODING
Disable Transfer decoding. See CURLOPT_HTTP_TRANSFER_DECODING
HTTP version to use. CURLOPT_HTTP_VERSION
Ignore Content-Length. See CURLOPT_IGNORE_CONTENT_LENGTH
Size of file to send. CURLOPT_INFILESIZE
Size of file to send. CURLOPT_INFILESIZE_LARGE
Bind connection locally to this. See CURLOPT_INTERFACE
Data pointer to pass to the RTSP interleave callback. See CURLOPT_INTERLEAVEDATA
Callback for RTSP interleaved data. See CURLOPT_INTERLEAVEFUNCTION
Deprecated option Data pointer to pass to the I/O callback. See CURLOPT_IOCTLDATA
Deprecated option Callback for I/O operations. See CURLOPT_IOCTLFUNCTION
IP version to use. See CURLOPT_IPRESOLVE
Issuer certificate. See CURLOPT_ISSUERCERT
Issuer certificate memory buffer. See CURLOPT_ISSUERCERT_BLOB
Keep sending on HTTP >= 300 errors. CURLOPT_KEEP_SENDING_ON_ERROR
Client key password. See CURLOPT_KEYPASSWD
Kerberos security level. See CURLOPT_KRBLEVEL
Bind connection locally to this port. See CURLOPT_LOCALPORT
Bind connection locally to port range. See CURLOPT_LOCALPORTRANGE
Login options. See CURLOPT_LOGIN_OPTIONS
Low speed limit to abort transfer. See CURLOPT_LOW_SPEED_LIMIT
Time to be below the speed to trigger low speed abort. See CURLOPT_LOW_SPEED_TIME
Authentication address. See CURLOPT_MAIL_AUTH
Address of the sender. See CURLOPT_MAIL_FROM
Address of the recipients. See CURLOPT_MAIL_RCPT
Allow RCPT TO command to fail for some recipients. See CURLOPT_MAIL_RCPT_ALLOWFAILS
Limit the age (idle time) of connections for reuse. See CURLOPT_MAXAGE_CONN
Maximum number of connections in the connection pool. See CURLOPT_MAXCONNECTS
Maximum file size to get. See CURLOPT_MAXFILESIZE
Maximum file size to get. See CURLOPT_MAXFILESIZE_LARGE
Limit the age (since creation) of connections for reuse. See CURLOPT_MAXLIFETIME_CONN
Maximum number of redirects to follow. See CURLOPT_MAXREDIRS
Cap the download speed to this. See CURLOPT_MAX_RECV_SPEED_LARGE
Cap the upload speed to this. See CURLOPT_MAX_SEND_SPEED_LARGE
Post/send MIME data. See CURLOPT_MIMEPOST
Set MIME option flags. See CURLOPT_MIME_OPTIONS
Enable .netrc parsing. See CURLOPT_NETRC
.netrc filename. See CURLOPT_NETRC_FILE
Mode for creating new remote directories. See CURLOPT_NEW_DIRECTORY_PERMS
Mode for creating new remote files. See CURLOPT_NEW_FILE_PERMS
Do not get the body contents. See CURLOPT_NOBODY
Shut off the progress meter. See CURLOPT_NOPROGRESS
Filter out hosts from proxy use. CURLOPT_NOPROXY
Do not install signal handlers. See CURLOPT_NOSIGNAL
Data pointer to pass to the open socket callback. See CURLOPT_OPENSOCKETDATA
Callback for socket creation. See CURLOPT_OPENSOCKETFUNCTION
Password. See CURLOPT_PASSWORD
Disable squashing /../ and /./ sequences in the path. See CURLOPT_PATH_AS_IS
Set pinned SSL public key . See CURLOPT_PINNEDPUBLICKEY
Wait on connection to pipeline on it. See CURLOPT_PIPEWAIT
Port number to connect to. See CURLOPT_PORT
Make an HTTP POST. See CURLOPT_POST
The POST data is this big. See CURLOPT_POSTFIELDSIZE
The POST data is this big. See CURLOPT_POSTFIELDSIZE_LARGE
Commands to run after transfer. See CURLOPT_POSTQUOTE
How to act on redirects after POST. See CURLOPT_POSTREDIR
Commands to run just before transfer. See CURLOPT_PREQUOTE
Data pointer to pass to the CURLOPT_PREREQFUNCTION callback. See CURLOPT_PREREQDATA
Callback to be called after a connection is established but before a request is made on that connection. See CURLOPT_PREREQFUNCTION
Socks proxy to use. See CURLOPT_PRE_PROXY
Private pointer to store. See CURLOPT_PRIVATE
Data pointer to pass to the progress meter callback. See CURLOPT_PROGRESSDATA
OBSOLETE callback for progress meter. See CURLOPT_PROGRESSFUNCTION
Deprecated option Allowed protocols. See CURLOPT_PROTOCOLS
Allowed protocols. See CURLOPT_PROTOCOLS_STR
Proxy to use. See CURLOPT_PROXY
HTTP proxy authentication methods. See CURLOPT_PROXYAUTH
Custom HTTP headers sent to proxy. See CURLOPT_PROXYHEADER
Proxy password. See CURLOPT_PROXYPASSWORD
Proxy port to use. See CURLOPT_PROXYPORT
Proxy type. See CURLOPT_PROXYTYPE
Proxy username. See CURLOPT_PROXYUSERNAME
Proxy username and password. See CURLOPT_PROXYUSERPWD
Proxy CA cert bundle. See CURLOPT_PROXY_CAINFO
Proxy CA cert bundle memory buffer. See CURLOPT_PROXY_CAINFO_BLOB
Path to proxy CA cert bundle. See CURLOPT_PROXY_CAPATH
Proxy Certificate Revocation List. See CURLOPT_PROXY_CRLFILE
Proxy issuer certificate. See CURLOPT_PROXY_ISSUERCERT
Proxy issuer certificate memory buffer. See CURLOPT_PROXY_ISSUERCERT_BLOB
Proxy client key password. See CURLOPT_PROXY_KEYPASSWD
Set the proxy's pinned SSL public key. See CURLOPT_PROXY_PINNEDPUBLICKEY
Proxy authentication service name. CURLOPT_PROXY_SERVICE_NAME
Proxy client cert. See CURLOPT_PROXY_SSLCERT
Proxy client cert type. See CURLOPT_PROXY_SSLCERTTYPE
Proxy client cert memory buffer. See CURLOPT_PROXY_SSLCERT_BLOB
Proxy client key. See CURLOPT_PROXY_SSLKEY
Proxy client key type. See CURLOPT_PROXY_SSLKEYTYPE
Proxy client key. See CURLOPT_PROXY_SSLKEY_BLOB
Proxy SSL version to use. See CURLOPT_PROXY_SSLVERSION
Proxy ciphers to use. See CURLOPT_PROXY_SSL_CIPHER_LIST
Control proxy SSL behavior. See CURLOPT_PROXY_SSL_OPTIONS
Verify the hostname in the proxy SSL certificate. See CURLOPT_PROXY_SSL_VERIFYHOST
Verify the proxy SSL certificate. See CURLOPT_PROXY_SSL_VERIFYPEER
Proxy TLS 1.3 cipher suites to use. See CURLOPT_PROXY_TLS13_CIPHERS
CURLOPT_PROXY_TLSAUTH_PASSWORD
Proxy TLS authentication password. See CURLOPT_PROXY_TLSAUTH_PASSWORD
Proxy TLS authentication methods. See CURLOPT_PROXY_TLSAUTH_TYPE
CURLOPT_PROXY_TLSAUTH_USERNAME
Proxy TLS authentication username. See CURLOPT_PROXY_TLSAUTH_USERNAME
Add transfer mode to URL over proxy. See CURLOPT_PROXY_TRANSFER_MODE
Deprecated option Issue an HTTP PUT request. See CURLOPT_PUT
To be set by toplevel tools like "curl" to skip lengthy cleanups when they are about to call exit() anyway. See CURLOPT_QUICK_EXIT
Commands to run before transfer. See CURLOPT_QUOTE
OBSOLETE Provide source for entropy random data. See CURLOPT_RANDOM_FILE
Range requests. See CURLOPT_RANGE
Data pointer to pass to the read callback. See CURLOPT_READDATA
Callback for reading data. See CURLOPT_READFUNCTION
Deprecated option Protocols to allow redirects to. See CURLOPT_REDIR_PROTOCOLS
Protocols to allow redirects to. See CURLOPT_REDIR_PROTOCOLS_STR
Referer: header. See CURLOPT_REFERER
Set the request target. CURLOPT_REQUEST_TARGET
Provide fixed/fake name resolves. See CURLOPT_RESOLVE
Data pointer to pass to resolver start callback. See CURLOPT_RESOLVER_START_DATA
CURLOPT_RESOLVER_START_FUNCTION
Callback to be called before a new resolve request is started. See CURLOPT_RESOLVER_START_FUNCTION
Resume a transfer. See CURLOPT_RESUME_FROM
Resume a transfer. See CURLOPT_RESUME_FROM_LARGE
Client CSEQ number. See CURLOPT_RTSP_CLIENT_CSEQ
RTSP request. See CURLOPT_RTSP_REQUEST
CSEQ number for RTSP Server->Client request. See CURLOPT_RTSP_SERVER_CSEQ
RTSP session-id. See CURLOPT_RTSP_SESSION_ID
RTSP stream URI. See CURLOPT_RTSP_STREAM_URI
RTSP Transport: header. See CURLOPT_RTSP_TRANSPORT
SASL authorization identity (identity to act as). See CURLOPT_SASL_AUTHZID
Enable SASL initial response. See CURLOPT_SASL_IR
Data pointer to pass to the seek callback. See CURLOPT_SEEKDATA
Callback for seek operations. See CURLOPT_SEEKFUNCTION
CURLOPT_SERVER_RESPONSE_TIMEOUT
Timeout for server responses. See CURLOPT_SERVER_RESPONSE_TIMEOUT
CURLOPT_SERVER_RESPONSE_TIMEOUT_MS
Timeout for server responses. See CURLOPT_SERVER_RESPONSE_TIMEOUT_MS
Authentication service name. CURLOPT_SERVICE_NAME
Share object to use. See CURLOPT_SHARE
Data pointer to pass to the sockopt callback. See CURLOPT_SOCKOPTDATA
Callback for sockopt operations. See CURLOPT_SOCKOPTFUNCTION
Socks5 authentication methods. See CURLOPT_SOCKS5_AUTH
Socks5 GSSAPI NEC mode. See CURLOPT_SOCKS5_GSSAPI_NEC
Deprecated option Socks5 GSSAPI service name. See CURLOPT_SOCKS5_GSSAPI_SERVICE
SSH authentication types. See CURLOPT_SSH_AUTH_TYPES
Enable SSH compression. See CURLOPT_SSH_COMPRESSION
Custom pointer to pass to ssh host key callback. See CURLOPT_SSH_HOSTKEYDATA
Callback for checking host key handling. See CURLOPT_SSH_HOSTKEYFUNCTION
CURLOPT_SSH_HOST_PUBLIC_KEY_MD5
MD5 of host's public key. See CURLOPT_SSH_HOST_PUBLIC_KEY_MD5
CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256
SHA256 of host's public key. See CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256
Custom pointer to pass to ssh key callback. See CURLOPT_SSH_KEYDATA
Callback for known hosts handling. See CURLOPT_SSH_KEYFUNCTION
Filename with known hosts. See CURLOPT_SSH_KNOWNHOSTS
Filename of the private key. See CURLOPT_SSH_PRIVATE_KEYFILE
Filename of the public key. See CURLOPT_SSH_PUBLIC_KEYFILE
Client cert. See CURLOPT_SSLCERT
Client cert type. See CURLOPT_SSLCERTTYPE
Client cert memory buffer. See CURLOPT_SSLCERT_BLOB
Use identifier with SSL engine. See CURLOPT_SSLENGINE
Default SSL engine. See CURLOPT_SSLENGINE_DEFAULT
Client key. See CURLOPT_SSLKEY
Client key type. See CURLOPT_SSLKEYTYPE
Client key memory buffer. See CURLOPT_SSLKEY_BLOB
SSL version to use. See CURLOPT_SSLVERSION
Ciphers to use. See CURLOPT_SSL_CIPHER_LIST
Data pointer to pass to the SSL context callback. See CURLOPT_SSL_CTX_DATA
Callback for SSL context logic. See CURLOPT_SSL_CTX_FUNCTION
Set key exchange curves. See CURLOPT_SSL_EC_CURVES
Enable use of ALPN. See CURLOPT_SSL_ENABLE_ALPN
OBSOLETE Enable use of NPN. See CURLOPT_SSL_ENABLE_NPN
Enable TLS False Start. See CURLOPT_SSL_FALSESTART
Control SSL behavior. See CURLOPT_SSL_OPTIONS
Disable SSL session-id cache. See CURLOPT_SSL_SESSIONID_CACHE
Verify the hostname in the SSL certificate. See CURLOPT_SSL_VERIFYHOST
Verify the SSL certificate. See CURLOPT_SSL_VERIFYPEER
Verify the SSL certificate's status. See CURLOPT_SSL_VERIFYSTATUS
Redirect stderr to another stream. See CURLOPT_STDERR
This HTTP/2 stream depends on another. See CURLOPT_STREAM_DEPENDS
This HTTP/2 stream depends on another exclusively. See CURLOPT_STREAM_DEPENDS_E
Set this HTTP/2 stream's weight. See CURLOPT_STREAM_WEIGHT
CURLOPT_SUPPRESS_CONNECT_HEADERS
Suppress proxy CONNECT response headers from user callbacks. See CURLOPT_SUPPRESS_CONNECT_HEADERS
Enable TCP Fast Open. See CURLOPT_TCP_FASTOPEN
Enable TCP keep-alive. See CURLOPT_TCP_KEEPALIVE
Maximum number of keep-alive probes. See CURLOPT_TCP_KEEPCNT
Idle time before sending keep-alive. See CURLOPT_TCP_KEEPIDLE
Interval between keep-alive probes. See CURLOPT_TCP_KEEPINTVL
Disable the Nagle algorithm. See CURLOPT_TCP_NODELAY
TELNET options. See CURLOPT_TELNETOPTIONS
TFTP block size. See CURLOPT_TFTP_BLKSIZE
Do not send TFTP options requests. See CURLOPT_TFTP_NO_OPTIONS
Make a time conditional request. See CURLOPT_TIMECONDITION
Timeout for the entire request. See CURLOPT_TIMEOUT
Millisecond timeout for the entire request. See CURLOPT_TIMEOUT_MS
Time value for the time conditional request. See CURLOPT_TIMEVALUE
Time value for the time conditional request. See CURLOPT_TIMEVALUE_LARGE
TLS 1.3 cipher suites to use. See CURLOPT_TLS13_CIPHERS
TLS authentication password. See CURLOPT_TLSAUTH_PASSWORD
TLS authentication methods. See CURLOPT_TLSAUTH_TYPE
TLS authentication username. See CURLOPT_TLSAUTH_USERNAME
Custom pointer passed to the trailing headers callback. See CURLOPT_TRAILERDATA
Set callback for sending trailing headers. See CURLOPT_TRAILERFUNCTION
Use text transfer. See CURLOPT_TRANSFERTEXT
Request Transfer-Encoding. See CURLOPT_TRANSFER_ENCODING
Path to a Unix domain socket. See CURLOPT_UNIX_SOCKET_PATH
Do not restrict authentication to original host. CURLOPT_UNRESTRICTED_AUTH
Sets the interval at which connection upkeep are performed. See CURLOPT_UPKEEP_INTERVAL_MS
Upload data. See CURLOPT_UPLOAD
Set upload buffer size. See CURLOPT_UPLOAD_BUFFERSIZE
URL to work on. See CURLOPT_URL
User-Agent: header. See CURLOPT_USERAGENT
Username. See CURLOPT_USERNAME
Username and password. See CURLOPT_USERPWD
Use TLS/SSL. See CURLOPT_USE_SSL
Display verbose information. See CURLOPT_VERBOSE
Transfer multiple files according to a filename pattern. See CURLOPT_WILDCARDMATCH
Data pointer to pass to the write callback. See CURLOPT_WRITEDATA
Callback for writing data. See CURLOPT_WRITEFUNCTION
Set WebSocket options. See CURLOPT_WS_OPTIONS
Data pointer to pass to the progress meter callback. See CURLOPT_XFERINFODATA
Callback for progress meter. See CURLOPT_XFERINFOFUNCTION
OAuth2 bearer token. See CURLOPT_XOAUTH2_BEARER
Protocols
This functionality affects all supported protocols
Example
int main(void) { CURL *curl = curl_easy_init(); if(curl) { CURLcode res; curl_easy_setopt(curl, CURLOPT_URL, "https://example.com"); res = curl_easy_perform(curl); curl_easy_cleanup(curl); } }
Availability
Added in curl 7.1
Return value
CURLE_OK (zero) means that the option was set properly, non-zero means an error occurred as <curl/curl.h> defines. See the libcurl-errors man page for the full list with descriptions.
Strings passed on to libcurl must be shorter than 8000000 bytes, otherwise curl_easy_setopt returns CURLE_BAD_FUNCTION_ARGUMENT (added in 7.65.0).
CURLE_BAD_FUNCTION_ARGUMENT is returned when the argument to an option is invalid, like perhaps out of range.
If you try to set an option that libcurl does not know about, perhaps because the library is too old to support it or the option was removed in a recent version, this function returns CURLE_UNKNOWN_OPTION. If support for the option was disabled at compile-time, it returns CURLE_NOT_BUILT_IN.
See also
curl_easy_cleanup(3), curl_easy_getinfo(3), curl_easy_init(3), curl_easy_option_by_id(3), curl_easy_option_by_name(3), curl_easy_option_next(3), curl_easy_reset(3), curl_multi_setopt(3)
This HTML page was made with roffit.