~ubuntu-branches/ubuntu/saucy/curl/saucy-201307251546

« back to all changes in this revision

Viewing changes to docs/libcurl/curl_easy_setopt.html

  • Committer: Package Import Robot
  • Author(s): Alessandro Ghedini
  • Date: 2012-03-23 16:24:51 UTC
  • mto: (3.6.1 experimental) (1.3.1)
  • mto: This revision was merged to the branch mainline in revision 59.
  • Revision ID: package-import@ubuntu.com-20120323162451-z4gstlabjkgnrh7h
Tags: upstream-7.25.0
ImportĀ upstreamĀ versionĀ 7.25.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
127
127
<p class="level1">Function pointer that should match the following prototype: <span class="emphasis">int function(void *instream, curl_off_t offset, int origin);</span> This function gets called by libcurl to seek to a certain position in the input stream and can be used to fast forward a file in a resumed upload (instead of reading all uploaded bytes with the normal read function/callback). It is also called to rewind a stream when doing a HTTP PUT or POST with a multi-pass authentication method. The function shall work like "fseek" or "lseek" and accepted SEEK_SET, SEEK_CUR and SEEK_END as argument for origin, although (in 7.18.0) libcurl only passes SEEK_SET. The callback must return 0 (CURL_SEEKFUNC_OK) on success, 1 (CURL_SEEKFUNC_FAIL) to cause the upload operation to fail or 2 (CURL_SEEKFUNC_CANTSEEK) to indicate that while the seek failed, libcurl is free to work around the problem if possible. The latter can sometimes be done by instead reading from the input or similar. 
128
128
<p class="level1">If you forward the input arguments directly to "fseek" or "lseek", note that the data type for <span Class="emphasis">offset</span> is not the same as defined for curl_off_t on many systems! (Option added in 7.18.0) 
129
129
<p class="level0"><a name="CURLOPTSEEKDATA"></a><span class="nroffip">CURLOPT_SEEKDATA</span> 
130
 
<p class="level1">Data pointer to pass to the file read function. If you use the <a class="emphasis" href="#CURLOPTSEEKFUNCTION">CURLOPT_SEEKFUNCTION</a> option, this is the pointer you'll get as input. If you don't specify a seek callback, NULL is passed. (Option added in 7.18.0) 
 
130
<p class="level1">Data pointer to pass to the file seek function. If you use the <a class="emphasis" href="#CURLOPTSEEKFUNCTION">CURLOPT_SEEKFUNCTION</a> option, this is the pointer you'll get as input. If you don't specify a seek callback, NULL is passed. (Option added in 7.18.0) 
131
131
<p class="level0"><a name="CURLOPTSOCKOPTFUNCTION"></a><span class="nroffip">CURLOPT_SOCKOPTFUNCTION</span> 
132
 
<p class="level1">Function pointer that should match the <span Class="emphasis">curl_sockopt_callback</span> prototype found in <span Class="emphasis">&lt;curl/curl.h&gt;</span>. This function gets called by libcurl after the socket() call but before the connect() call. The callback's <span Class="emphasis">purpose</span> argument identifies the exact purpose for this particular socket, and currently only one value is supported: <span Class="emphasis">CURLSOCKTYPE_IPCXN</span> for the primary connection (meaning the control connection in the FTP case). Future versions of libcurl may support more purposes. It passes the newly created socket descriptor so additional setsockopt() calls can be done at the user's discretion.  Return 0 (zero) from the callback on success. Return 1 from the callback function to signal an unrecoverable error to the library and it will close the socket and return <span Class="emphasis">CURLE_COULDNT_CONNECT</span>.  (Option added in 7.15.6.) 
 
132
<p class="level1">Function pointer that should match the <span Class="emphasis">curl_sockopt_callback</span> prototype found in <span Class="emphasis">&lt;curl/curl.h&gt;</span>. This function gets called by libcurl after the socket() call but before the connect() call. The callback's <span Class="emphasis">purpose</span> argument identifies the exact purpose for this particular socket, and currently only one value is supported: <span Class="emphasis">CURLSOCKTYPE_IPCXN</span> for the primary connection (meaning the control connection in the FTP case). Future versions of libcurl may support more purposes. It passes the newly created socket descriptor so additional setsockopt() calls can be done at the user's discretion.  Return 0 (zero) from the callback on success. Return 1 from the callback function to signal an unrecoverable error to the library and it will close the socket and return <span Class="emphasis">CURLE_COULDNT_CONNECT</span>.  (Option added in 7.16.0) 
133
133
<p class="level1">Added in 7.21.5, the callback function may return <span Class="emphasis">CURL_SOCKOPT_ALREADY_CONNECTED</span>, which tells libcurl that the socket is in fact already connected and then libcurl will not attempt to connect it. 
134
134
<p class="level0"><a name="CURLOPTSOCKOPTDATA"></a><span class="nroffip">CURLOPT_SOCKOPTDATA</span> 
135
 
<p class="level1">Pass a pointer that will be untouched by libcurl and passed as the first argument in the sockopt callback set with <a class="emphasis" href="#CURLOPTSOCKOPTFUNCTION">CURLOPT_SOCKOPTFUNCTION</a>. (Option added in 7.15.6.) 
 
135
<p class="level1">Pass a pointer that will be untouched by libcurl and passed as the first argument in the sockopt callback set with <a class="emphasis" href="#CURLOPTSOCKOPTFUNCTION">CURLOPT_SOCKOPTFUNCTION</a>. (Option added in 7.16.0) 
136
136
<p class="level0"><a name="CURLOPTOPENSOCKETFUNCTION"></a><span class="nroffip">CURLOPT_OPENSOCKETFUNCTION</span> 
137
137
<p class="level1">Function pointer that should match the <span Class="emphasis">curl_opensocket_callback</span> prototype found in <span Class="emphasis">&lt;curl/curl.h&gt;</span>. This function gets called by libcurl instead of the <span Class="emphasis">socket(2)</span> call. The callback's <span Class="emphasis">purpose</span> argument identifies the exact purpose for this particular socket: <span Class="emphasis">CURLSOCKTYPE_IPCXN</span> is for IP based connections. Future versions of libcurl may support more purposes. It passes the resolved peer address as a <span Class="emphasis">address</span> argument so the callback can modify the address or refuse to connect at all. The callback function should return the socket or <span Class="emphasis">CURL_SOCKET_BAD</span> in case no connection should be established or any error detected. Any additional <span Class="emphasis">setsockopt(2)</span> calls can be done on the socket at the user's discretion.  <span Class="emphasis">CURL_SOCKET_BAD</span> return value from the callback function will signal an unrecoverable error to the library and it will return <span Class="emphasis">CURLE_COULDNT_CONNECT</span>.  This return code can be used for IP address blacklisting.  The default behavior is: 
138
138
<p class="level1">&nbsp;  return socket(addr-&gt;family, addr-&gt;socktype, addr-&gt;protocol); 
142
142
<p class="level0"><a name="CURLOPTCLOSESOCKETFUNCTION"></a><span class="nroffip">CURLOPT_CLOSESOCKETFUNCTION</span> 
143
143
<p class="level1">Function pointer that should match the <span Class="emphasis">curl_closesocket_callback</span> prototype found in <span Class="emphasis">&lt;curl/curl.h&gt;</span>. This function gets called by libcurl instead of the <span Class="emphasis">close(3)</span> or <span Class="emphasis">closesocket(3)</span> call when sockets are closed (not for any other file descriptors). This is pretty much the reverse to the <a class="emphasis" href="#CURLOPTOPENSOCKETFUNCTION">CURLOPT_OPENSOCKETFUNCTION</a> option. Return 0 to signal success and 1 if there was an error.  (Option added in 7.21.7) 
144
144
<p class="level0"><a name="CURLOPTCLOSESOCKETDATA"></a><span class="nroffip">CURLOPT_CLOSESOCKETDATA</span> 
145
 
<p class="level1">Pass a pointer that will be untouched by libcurl and passed as the first argument in the opensocket callback set with <a class="emphasis" href="#CURLOPTCLOSESOCKETFUNCTION">CURLOPT_CLOSESOCKETFUNCTION</a>.  (Option added in 7.21.7) 
 
145
<p class="level1">Pass a pointer that will be untouched by libcurl and passed as the first argument in the closesocket callback set with <a class="emphasis" href="#CURLOPTCLOSESOCKETFUNCTION">CURLOPT_CLOSESOCKETFUNCTION</a>.  (Option added in 7.21.7) 
146
146
<p class="level0"><a name="CURLOPTPROGRESSFUNCTION"></a><span class="nroffip">CURLOPT_PROGRESSFUNCTION</span> 
147
147
<p class="level1">Function pointer that should match the <span Class="emphasis">curl_progress_callback</span> prototype found in <span Class="emphasis">&lt;curl/curl.h&gt;</span>. This function gets called by libcurl instead of its internal equivalent with a frequent interval during operation (roughly once per second or sooner) no matter if data is being transfered or not. Unknown/unused argument values passed to the callback will be set to zero (like if you only download data, the upload size will remain 0). Returning a non-zero value from this callback will cause libcurl to abort the transfer and return <span Class="emphasis">CURLE_ABORTED_BY_CALLBACK</span>. 
148
148
<p class="level1">If you transfer data with the multi interface, this function will not be called during periods of idleness unless you call the appropriate libcurl function that performs transfers. 
176
176
<p class="level1">Pass a pointer to whatever you want passed in to your <a class="emphasis" href="#CURLOPTDEBUGFUNCTION">CURLOPT_DEBUGFUNCTION</a> in the last void * argument. This pointer is not used by libcurl, it is only passed to the callback. 
177
177
<p class="level0"><a name="CURLOPTSSLCTXFUNCTION"></a><span class="nroffip">CURLOPT_SSL_CTX_FUNCTION</span> 
178
178
<p class="level1">This option does only function for libcurl powered by OpenSSL. If libcurl was built against another SSL library, this functionality is absent. 
179
 
<p class="level1">Function pointer that should match the following prototype: <span class="bold">CURLcode sslctxfun(CURL *curl, void *sslctx, void *parm);</span> This function gets called by libcurl just before the initialization of an SSL connection after having processed all other SSL related options to give a last chance to an application to modify the behaviour of openssl's ssl initialization. The <span Class="emphasis">sslctx</span> parameter is actually a pointer to an openssl <span Class="emphasis">SSL_CTX</span>. If an error is returned no attempt to establish a connection is made and the perform operation will return the error code from this callback function.  Set the <span Class="emphasis">parm</span> argument with the <a class="emphasis" href="#CURLOPTSSLCTXDATA">CURLOPT_SSL_CTX_DATA</a> option. This option was introduced in 7.11.0. 
 
179
<p class="level1">Function pointer that should match the following prototype: <span class="bold">CURLcode sslctxfun(CURL *curl, void *sslctx, void *parm);</span> This function gets called by libcurl just before the initialization of a SSL connection after having processed all other SSL related options to give a last chance to an application to modify the behaviour of openssl's ssl initialization. The <span Class="emphasis">sslctx</span> parameter is actually a pointer to an openssl <span Class="emphasis">SSL_CTX</span>. If an error is returned no attempt to establish a connection is made and the perform operation will return the error code from this callback function.  Set the <span Class="emphasis">parm</span> argument with the <a class="emphasis" href="#CURLOPTSSLCTXDATA">CURLOPT_SSL_CTX_DATA</a> option. This option was introduced in 7.11.0. 
180
180
<p class="level1">This function will get called on all new connections made to a server, during the SSL negotiation. The SSL_CTX pointer will be a new one every time. 
181
 
<p class="level1">To use this properly, a non-trivial amount of knowledge of the openssl libraries is necessary. For example, using this function allows you to use openssl callbacks to add additional validation code for certificates, and even to change the actual URI of an HTTPS request (example used in the lib509 test case).  See also the example section for a replacement of the key, certificate and trust file settings. 
 
181
<p class="level1">To use this properly, a non-trivial amount of knowledge of the openssl libraries is necessary. For example, using this function allows you to use openssl callbacks to add additional validation code for certificates, and even to change the actual URI of a HTTPS request (example used in the lib509 test case).  See also the example section for a replacement of the key, certificate and trust file settings. 
182
182
<p class="level0"><a name="CURLOPTSSLCTXDATA"></a><span class="nroffip">CURLOPT_SSL_CTX_DATA</span> 
183
183
<p class="level1">Data pointer to pass to the ssl context callback set by the option <a class="emphasis" href="#CURLOPTSSLCTXFUNCTION">CURLOPT_SSL_CTX_FUNCTION</a>, this is the pointer you'll get as third parameter, otherwise <span Class="bold">NULL</span>. (Added in 7.11.0) 
184
184
<p class="level0"><a name="CURLOPTCONVTONETWORKFUNCTION"></a><span class="nroffip">CURLOPT_CONV_TO_NETWORK_FUNCTION</span> 
268
268
<p class="level1">The path part of a POP3 request specifies the mailbox (message) to retrieve. If the mailbox is not specified then a list of waiting messages is returned instead. 
269
269
<p class="level1">pop3://user:password@mail.domain.com - This lists the available messages pop3://user:password@mail.domain.com/1 - This retrieves the first message 
270
270
<p class="level1"><span Class="bold">SCP</span> 
271
 
<p class="level1">The path part of an SCP request specifies the file to retrieve and from what directory. The file part may not be omitted. The file is taken as an absolute path from the root directory on the server. To specify a path relative to the user's home directory on the server, prepend ~/ to the path portion. If the user name is not embedded in the URL, it can be set with the <a class="emphasis" href="#CURLOPTUSERPWD">CURLOPT_USERPWD</a> or <a class="bold" href="#CURLOPTUSERNAME">CURLOPT_USERNAME</a> option. 
 
271
<p class="level1">The path part of a SCP request specifies the file to retrieve and from what directory. The file part may not be omitted. The file is taken as an absolute path from the root directory on the server. To specify a path relative to the user's home directory on the server, prepend ~/ to the path portion. If the user name is not embedded in the URL, it can be set with the <a class="emphasis" href="#CURLOPTUSERPWD">CURLOPT_USERPWD</a> or <a class="bold" href="#CURLOPTUSERNAME">CURLOPT_USERNAME</a> option. 
272
272
<p class="level1">scp://user@example.com/etc/issue - This specifies the file /etc/issue 
273
273
<p class="level1">scp://example.com/~/my-file - This specifies the file my-file in the user's home directory on the server 
274
274
<p class="level1"><span Class="bold">SFTP</span> 
275
 
<p class="level1">The path part of an SFTP request specifies the file to retrieve and from what directory. If the file part is omitted then libcurl downloads the directory listing for the directory specified.  If the path ends in a / then a directory listing is returned instead of a file.  If the path is omitted entirely then the directory listing for the root / home directory will be returned. If the user name is not embedded in the URL, it can be set with the <a class="emphasis" href="#CURLOPTUSERPWD">CURLOPT_USERPWD</a> or <a class="bold" href="#CURLOPTUSERNAME">CURLOPT_USERNAME</a> option. 
 
275
<p class="level1">The path part of a SFTP request specifies the file to retrieve and from what directory. If the file part is omitted then libcurl downloads the directory listing for the directory specified.  If the path ends in a / then a directory listing is returned instead of a file.  If the path is omitted entirely then the directory listing for the root / home directory will be returned. If the user name is not embedded in the URL, it can be set with the <a class="emphasis" href="#CURLOPTUSERPWD">CURLOPT_USERPWD</a> or <a class="bold" href="#CURLOPTUSERNAME">CURLOPT_USERNAME</a> option. 
276
276
<p class="level1">s<a href="ftp://user">ftp://user</a>:password@example.com/etc/issue - This specifies the file /etc/issue 
277
277
<p class="level1">s<a href="ftp://user">ftp://user</a>@example.com/~/my-file - This specifies the file my-file in the user's home directory 
278
278
<p class="level1">s<a href="ftp://ssh.example.com/">ftp://ssh.example.com/</a>~/Documents/ - This requests a directory listing of the Documents directory under the user's home directory 
286
286
<p class="level1">Pass a long that holds a bitmask of CURLPROTO_* defines. If used, this bitmask limits what protocols libcurl may use in a transfer that it follows to in a redirect when <a class="emphasis" href="#CURLOPTFOLLOWLOCATION">CURLOPT_FOLLOWLOCATION</a> is enabled. This allows you to limit specific transfers to only be allowed to use a subset of protocols in redirections. By default libcurl will allow all protocols except for FILE and SCP. This is a difference compared to pre-7.19.4 versions which unconditionally would follow to all protocols supported. (Added in 7.19.4) 
287
287
<p class="level0"><a name="CURLOPTPROXY"></a><span class="nroffip">CURLOPT_PROXY</span> 
288
288
<p class="level1">Set HTTP proxy to use. The parameter should be a char * to a zero terminated string holding the host name or dotted IP address. To specify port number in this string, append :[port] to the end of the host name. The proxy string may be prefixed with [protocol]:// since any such prefix will be ignored. The proxy's port number may optionally be specified with the separate option. If not specified, libcurl will default to using port 1080 for proxies. <a class="emphasis" href="#CURLOPTPROXYPORT">CURLOPT_PROXYPORT</a>. 
289
 
<p class="level1">When you tell the library to use an HTTP proxy, libcurl will transparently convert operations to HTTP even if you specify an FTP URL etc. This may have an impact on what other features of the library you can use, such as <a class="emphasis" href="#CURLOPTQUOTE">CURLOPT_QUOTE</a> and similar FTP specifics that don't work unless you tunnel through the HTTP proxy. Such tunneling is activated with <a class="emphasis" href="#CURLOPTHTTPPROXYTUNNEL">CURLOPT_HTTPPROXYTUNNEL</a>. 
 
289
<p class="level1">When you tell the library to use a HTTP proxy, libcurl will transparently convert operations to HTTP even if you specify an FTP URL etc. This may have an impact on what other features of the library you can use, such as <a class="emphasis" href="#CURLOPTQUOTE">CURLOPT_QUOTE</a> and similar FTP specifics that don't work unless you tunnel through the HTTP proxy. Such tunneling is activated with <a class="emphasis" href="#CURLOPTHTTPPROXYTUNNEL">CURLOPT_HTTPPROXYTUNNEL</a>. 
290
290
<p class="level1">libcurl respects the environment variables <span Class="bold">http_proxy</span>, <span Class="bold">ftp_proxy</span>, <span Class="bold">all_proxy</span> etc, if any of those are set. The <a class="emphasis" href="#CURLOPTPROXY">CURLOPT_PROXY</a> option does however override any possibly set environment variables. 
291
291
<p class="level1">Setting the proxy string to "" (an empty string) will explicitly disable the use of a proxy, even if there is an environment variable set for it. 
292
292
<p class="level1">Since 7.14.1, the proxy host string given in environment variables can be specified the exact same way as the proxy can be set with <a class="emphasis" href="#CURLOPTPROXY">CURLOPT_PROXY</a>, include protocol prefix (http://) and embedded user + password. 
294
294
<p class="level0"><a name="CURLOPTPROXYPORT"></a><span class="nroffip">CURLOPT_PROXYPORT</span> 
295
295
<p class="level1">Pass a long with this option to set the proxy port to connect to unless it is specified in the proxy string <a class="emphasis" href="#CURLOPTPROXY">CURLOPT_PROXY</a>. 
296
296
<p class="level0"><a name="CURLOPTPROXYTYPE"></a><span class="nroffip">CURLOPT_PROXYTYPE</span> 
297
 
<p class="level1">Pass a long with this option to set type of the proxy. Available options for this are <span Class="emphasis">CURLPROXY_HTTP</span>, <span Class="emphasis">CURLPROXY_HTTP_1_0</span> (added in 7.19.4), <span Class="emphasis">CURLPROXY_SOCKS4</span> (added in 7.15.2), <span Class="emphasis">CURLPROXY_SOCKS5</span>, <span Class="emphasis">CURLPROXY_SOCKS4A</span> (added in 7.18.0) and <span Class="emphasis">CURLPROXY_SOCKS5_HOSTNAME</span> (added in 7.18.0). The HTTP type is default. (Added in 7.10) 
 
297
<p class="level1">Pass a long with this option to set type of the proxy. Available options for this are <span Class="emphasis">CURLPROXY_HTTP</span>, <span Class="emphasis">CURLPROXY_HTTP_1_0</span> (added in 7.19.4), <span Class="emphasis">CURLPROXY_SOCKS4</span> (added in 7.10), <span Class="emphasis">CURLPROXY_SOCKS5</span>, <span Class="emphasis">CURLPROXY_SOCKS4A</span> (added in 7.18.0) and <span Class="emphasis">CURLPROXY_SOCKS5_HOSTNAME</span> (added in 7.18.0). The HTTP type is default. (Added in 7.10) 
298
298
<p class="level1">If you set <a class="bold" href="#CURLOPTPROXYTYPE">CURLOPT_PROXYTYPE</a> to <span Class="emphasis">CURLPROXY_HTTP_1_0</span>, it will only affect how libcurl speaks to a proxy when CONNECT is used. The HTTP version used for "regular" HTTP requests is instead controlled with <a class="emphasis" href="#CURLOPTHTTPVERSION">CURLOPT_HTTP_VERSION</a>. 
299
299
<p class="level0"><a name="CURLOPTNOPROXY"></a><span class="nroffip">CURLOPT_NOPROXY</span> 
300
 
<p class="level1">Pass a pointer to a zero terminated string. The should be a comma separated list of hosts which do not use a proxy, if one is specified.  The only wildcard is a single * character, which matches all hosts, and effectively disables the proxy. Each name in this list is matched as either a domain which contains the hostname, or the hostname itself. For example, local.com would match local.com, local.com:80, and www.local.com, but not www.notlocal.com. (Added in 7.19.4) 
 
300
<p class="level1">Pass a pointer to a zero terminated string. This should be a comma separated list of hosts which do not use a proxy, if one is specified.  The only wildcard is a single * character, which matches all hosts, and effectively disables the proxy. Each name in this list is matched as either a domain which contains the hostname, or the hostname itself. For example, local.com would match local.com, local.com:80, and www.local.com, but not www.notlocal.com. (Added in 7.19.4) 
301
301
<p class="level0"><a name="CURLOPTHTTPPROXYTUNNEL"></a><span class="nroffip">CURLOPT_HTTPPROXYTUNNEL</span> 
302
302
<p class="level1">Set the parameter to 1 to make the library tunnel all operations through a given HTTP proxy. There is a big difference between using a proxy and to tunnel through it. If you don't know what this means, you probably don't want this tunneling option. 
303
303
<p class="level0"><a name="CURLOPTSOCKS5GSSAPISERVICE"></a><span class="nroffip">CURLOPT_SOCKS5_GSSAPI_SERVICE</span> 
327
327
<p class="level1">Setting this option will disable TCP's Nagle algorithm. The purpose of this algorithm is to try to minimize the number of small packets on the network (where "small packets" means TCP segments less than the Maximum Segment Size (MSS) for the network). 
328
328
<p class="level1">Maximizing the amount of data sent per TCP segment is good because it amortizes the overhead of the send. However, in some cases (most notably telnet or rlogin) small segments may need to be sent without delay. This is less efficient than sending larger amounts of data at a time, and can contribute to congestion on the network if overdone. 
329
329
<p class="level0"><a name="CURLOPTADDRESSSCOPE"></a><span class="nroffip">CURLOPT_ADDRESS_SCOPE</span> 
330
 
<p class="level1">Pass a long specifying the scope_id value to use when connecting to IPv6 link-local or site-local addresses. (Added in 7.19.0) <a name="NAMES"></a><h2 class="nroffsh">NAMES and PASSWORDS OPTIONS (Authentication)</h2>
 
330
<p class="level1">Pass a long specifying the scope_id value to use when connecting to IPv6 link-local or site-local addresses. (Added in 7.19.0) 
 
331
<p class="level0"><a name="CURLOPTTCPKEEPALIVE"></a><span class="nroffip">CURLOPT_TCP_KEEPALIVE</span> 
 
332
<p class="level1">Pass a long. If set to 1, TCP keepalive probes will be sent. The delay and frequency of these probes can be controlled by the <a class="emphasis" href="#CURLOPTTCPKEEPIDLE">CURLOPT_TCP_KEEPIDLE</a> and <a class="emphasis" href="#CURLOPTTCPKEEPINTVL">CURLOPT_TCP_KEEPINTVL</a> options, provided the operating system supports them. Set to 0 (default behavior) to disable keepalive probes (Added in 7.25.0). 
 
333
<p class="level0"><a name="CURLOPTTCPKEEPIDLE"></a><span class="nroffip">CURLOPT_TCP_KEEPIDLE</span> 
 
334
<p class="level1">Pass a long. Sets the delay, in seconds, that the operating system will wait while the connection is idle before sending keepalive probes. Not all operating systems support this option. (Added in 7.25.0) 
 
335
<p class="level0"><a name="CURLOPTTCPKEEPINTVL"></a><span class="nroffip">CURLOPT_TCP_KEEPINTVL</span> 
 
336
<p class="level1">Pass a long. Sets the interval, in seconds, that the operating system will wait between sending keepalive probes. Not all operating systems support this option. (Added in 7.25.0) <a name="NAMES"></a><h2 class="nroffsh">NAMES and PASSWORDS OPTIONS (Authentication)</h2>
331
337
<p class="level0">
332
338
<p class="level0"><a name="CURLOPTNETRC"></a><span class="nroffip">CURLOPT_NETRC</span> 
333
339
<p class="level1">This parameter controls the preference of libcurl between using user names and passwords from your <span Class="emphasis">~/.netrc</span> file, relative to user names and passwords in the URL supplied with <a class="emphasis" href="#CURLOPTURL">CURLOPT_URL</a>. 
380
386
<p class="level2">You need to build libcurl with a suitable GSS-API library for this to work. 
381
387
<p class="level1"><a name="CURLAUTHNTLM"></a><span class="nroffip">CURLAUTH_NTLM</span> 
382
388
<p class="level2">HTTP NTLM authentication. A proprietary protocol invented and used by Microsoft. It uses a challenge-response and hash concept similar to Digest, to prevent the password from being eavesdropped. 
383
 
<p class="level2">You need to build libcurl with OpenSSL support for this option to work, or build libcurl on Windows. 
 
389
<p class="level2">You need to build libcurl with either OpenSSL or NSS support for this option to work, or build libcurl on Windows. 
384
390
<p class="level1"><a name="CURLAUTHNTLMWB"></a><span class="nroffip">CURLAUTH_NTLM_WB</span> 
385
391
<p class="level2">NTLM delegating to winbind helper. Authentication is performed by a separate binary application that is executed when needed. The name of the application is specified at compile time but is typically /usr/bin/ntlm_auth (Added in 7.22.0) 
386
392
<p class="level2">Note that libcurl will fork when necessary to run the winbind application and kill it when complete, calling waitpid() to await its exit when done. On POSIX operating systems, killing the process will cause a SIGCHLD signal to be raised (regardless of whether <a class="emphasis" href="#CURLOPTNOSIGNAL">CURLOPT_NOSIGNAL</a> is set), which must be handled intelligently by the application. In particular, the application must not unconditionally call wait() in its SIGCHLD signal handler to avoid being subject to a race condition.  This behavior is subject to change in future versions of libcurl. 
408
414
<p class="level0"><a name="CURLOPTAUTOREFERER"></a><span class="nroffip">CURLOPT_AUTOREFERER</span> 
409
415
<p class="level1">Pass a parameter set to 1 to enable this. When enabled, libcurl will automatically set the Referer: field in requests where it follows a Location: redirect. 
410
416
<p class="level0"><a name="CURLOPTACCEPTENCODING"></a><span class="nroffip">CURLOPT_ACCEPT_ENCODING</span> 
411
 
<p class="level1">Sets the contents of the Accept-Encoding: header sent in an HTTP request, and enables decoding of a response when a Content-Encoding: header is received. Three encodings are supported: <span Class="emphasis">identity</span>, which does nothing, <span Class="emphasis">deflate</span> which requests the server to compress its response using the zlib algorithm, and <span Class="emphasis">gzip</span> which requests the gzip algorithm.  If a zero-length string is set, then an Accept-Encoding: header containing all supported encodings is sent. 
 
417
<p class="level1">Sets the contents of the Accept-Encoding: header sent in a HTTP request, and enables decoding of a response when a Content-Encoding: header is received. Three encodings are supported: <span Class="emphasis">identity</span>, which does nothing, <span Class="emphasis">deflate</span> which requests the server to compress its response using the zlib algorithm, and <span Class="emphasis">gzip</span> which requests the gzip algorithm.  If a zero-length string is set, then an Accept-Encoding: header containing all supported encodings is sent. 
412
418
<p class="level1">This is a request, not an order; the server may or may not do it.  This option must be set (to any non-NULL value) or else any unsolicited encoding done by the server is ignored. See the special file lib/README.encoding for details. 
413
419
<p class="level1">(This option was called CURLOPT_ENCODING before 7.21.6) 
414
420
<p class="level0"><a name="CURLOPTTRANSFERENCODING"></a><span class="nroffip">CURLOPT_TRANSFER_ENCODING</span> 
416
422
<p class="level1">Transfer-Encoding differs slightly from the Content-Encoding you ask for with <a class="bold" href="#CURLOPTACCEPTENCODING">CURLOPT_ACCEPT_ENCODING</a> in that a Transfer-Encoding is strictly meant to be for the transfer and thus MUST be decoded before the data arrives in the client. Traditionally, Transfer-Encoding has been much less used and supported by both HTTP clients and HTTP servers. 
417
423
<p class="level1">(Added in 7.21.6) 
418
424
<p class="level0"><a name="CURLOPTFOLLOWLOCATION"></a><span class="nroffip">CURLOPT_FOLLOWLOCATION</span> 
419
 
<p class="level1">A parameter set to 1 tells the library to follow any Location: header that the server sends as part of an HTTP header. 
 
425
<p class="level1">A parameter set to 1 tells the library to follow any Location: header that the server sends as part of a HTTP header. 
420
426
<p class="level1">This means that the library will re-send the same request on the new location and follow new Location: headers all the way until no more such headers are returned. <a class="emphasis" href="#CURLOPTMAXREDIRS">CURLOPT_MAXREDIRS</a> can be used to limit the number of redirects libcurl will follow. 
421
427
<p class="level1">Since 7.19.4, libcurl can limit what protocols it will automatically follow. The accepted protocols are set with <a class="emphasis" href="#CURLOPTREDIRPROTOCOLS">CURLOPT_REDIR_PROTOCOLS</a> and it excludes the FILE protocol by default. 
422
428
<p class="level0"><a name="CURLOPTUNRESTRICTEDAUTH"></a><span class="nroffip">CURLOPT_UNRESTRICTED_AUTH</span> 
439
445
<p class="level1">When setting <a class="emphasis" href="#CURLOPTPOST">CURLOPT_POST</a> to 1, it will automatically set <a class="emphasis" href="#CURLOPTNOBODY">CURLOPT_NOBODY</a> to 0 (since 7.14.1). 
440
446
<p class="level1">If you issue a POST request and then want to make a HEAD or GET using the same re-used handle, you must explicitly set the new request type using <a class="emphasis" href="#CURLOPTNOBODY">CURLOPT_NOBODY</a> or <a class="emphasis" href="#CURLOPTHTTPGET">CURLOPT_HTTPGET</a> or similar. 
441
447
<p class="level0"><a name="CURLOPTPOSTFIELDS"></a><span class="nroffip">CURLOPT_POSTFIELDS</span> 
442
 
<p class="level1">Pass a void * as parameter, which should be the full data to post in an HTTP POST operation. You must make sure that the data is formatted the way you want the server to receive it. libcurl will not convert or encode it for you. Most web servers will assume this data to be url-encoded. 
 
448
<p class="level1">Pass a void * as parameter, which should be the full data to post in a HTTP POST operation. You must make sure that the data is formatted the way you want the server to receive it. libcurl will not convert or encode it for you. Most web servers will assume this data to be url-encoded. 
443
449
<p class="level1">The pointed data are NOT copied by the library: as a consequence, they must be preserved by the calling application until the transfer finishes. 
444
450
<p class="level1">This POST is a normal application/x-www-form-urlencoded kind (and libcurl will set that Content-Type by default when this option is used), which is the most commonly used one by HTML forms. See also the <a class="emphasis" href="#CURLOPTPOST">CURLOPT_POST</a>. Using <a class="emphasis" href="#CURLOPTPOSTFIELDS">CURLOPT_POSTFIELDS</a> implies <a class="emphasis" href="#CURLOPTPOST">CURLOPT_POST</a>. 
445
451
<p class="level1">If you want to do a zero-byte POST, you need to set <a class="emphasis" href="#CURLOPTPOSTFIELDSIZE">CURLOPT_POSTFIELDSIZE</a> explicitly to zero, as simply setting <a class="emphasis" href="#CURLOPTPOSTFIELDS">CURLOPT_POSTFIELDS</a> to NULL or "" just effectively disables the sending of the specified string. libcurl will instead assume that you'll send the POST data using the read callback! 
450
456
<p class="level0"><a name="CURLOPTPOSTFIELDSIZELARGE"></a><span class="nroffip">CURLOPT_POSTFIELDSIZE_LARGE</span> 
451
457
<p class="level1">Pass a curl_off_t as parameter. Use this to set the size of the <a class="emphasis" href="#CURLOPTPOSTFIELDS">CURLOPT_POSTFIELDS</a> data to prevent libcurl from doing strlen() on the data to figure out the size. This is the large file version of the <a class="emphasis" href="#CURLOPTPOSTFIELDSIZE">CURLOPT_POSTFIELDSIZE</a> option. (Added in 7.11.1) 
452
458
<p class="level0"><a name="CURLOPTCOPYPOSTFIELDS"></a><span class="nroffip">CURLOPT_COPYPOSTFIELDS</span> 
453
 
<p class="level1">Pass a char * as parameter, which should be the full data to post in an HTTP POST operation. It behaves as the <a class="emphasis" href="#CURLOPTPOSTFIELDS">CURLOPT_POSTFIELDS</a> option, but the original data are copied by the library, allowing the application to overwrite the original data after setting this option. 
 
459
<p class="level1">Pass a char * as parameter, which should be the full data to post in a HTTP POST operation. It behaves as the <a class="emphasis" href="#CURLOPTPOSTFIELDS">CURLOPT_POSTFIELDS</a> option, but the original data are copied by the library, allowing the application to overwrite the original data after setting this option. 
454
460
<p class="level1">Because data are copied, care must be taken when using this option in conjunction with <a class="emphasis" href="#CURLOPTPOSTFIELDSIZE">CURLOPT_POSTFIELDSIZE</a> or <a class="emphasis" href="#CURLOPTPOSTFIELDSIZELARGE">CURLOPT_POSTFIELDSIZE_LARGE</a>: If the size has not been set prior to <a class="emphasis" href="#CURLOPTCOPYPOSTFIELDS">CURLOPT_COPYPOSTFIELDS</a>, the data are assumed to be a NUL-terminated string; else the stored size informs the library about the data byte count to copy. In any case, the size must not be changed after <a class="emphasis" href="#CURLOPTCOPYPOSTFIELDS">CURLOPT_COPYPOSTFIELDS</a>, unless another <a class="emphasis" href="#CURLOPTPOSTFIELDS">CURLOPT_POSTFIELDS</a> or <a class="emphasis" href="#CURLOPTCOPYPOSTFIELDS">CURLOPT_COPYPOSTFIELDS</a> option is issued. (Added in 7.17.1) 
455
461
<p class="level0"><a name="CURLOPTHTTPPOST"></a><span class="nroffip">CURLOPT_HTTPPOST</span> 
456
462
<p class="level1">Tells libcurl you want a multipart/formdata HTTP POST to be made and you instruct what data to pass on to the server.  Pass a pointer to a linked list of curl_httppost structs as parameter.  The easiest way to create such a list, is to use <a class="emphasis" href="./curl_formadd.html">curl_formadd(3)</a> as documented. The data in this list must remain intact until you close this curl handle again with <a class="emphasis" href="./curl_easy_cleanup.html">curl_easy_cleanup(3)</a>. 
506
512
<p class="level1">Pass a long to tell libcurl how to act on transfer decoding. If set to zero, transfer decoding will be disabled, if set to 1 it is enabled (default). libcurl does chunked transfer decoding by default unless this option is set to zero. (added in 7.16.2) <a name="SMTP"></a><h2 class="nroffsh">SMTP OPTIONS</h2>
507
513
<p class="level0">
508
514
<p class="level0"><a name="CURLOPTMAILFROM"></a><span class="nroffip">CURLOPT_MAIL_FROM</span> 
509
 
<p class="level1">Pass a pointer to a zero terminated string as parameter. It will be used to specify the sender address in a mail when sending an SMTP mail with libcurl. 
510
 
<p class="level1">An originator email address in SMTP lingo is specified within angle brackets (&lt;&gt;) which libcurl will not add for you before version 7.21.4. Failing to provide such brackets may cause the server to reject your mail. 
 
515
<p class="level1">Pass a pointer to a zero terminated string as parameter. This should be used to specify the sender's email address when sending SMTP mail with libcurl. 
 
516
<p class="level1">An originator email address should be specified with angled brackets (&lt;&gt;) around it, which if not specified, will be added by libcurl from version 7.21.4 onwards. Failing to provide such brackets may cause the server to reject the email. 
 
517
<p class="level1">If this parameter is not specified then an empty address will be sent to the mail server which may or may not cause the email to be rejected. 
511
518
<p class="level1">(Added in 7.20.0) 
512
519
<p class="level0"><a name="CURLOPTMAILRCPT"></a><span class="nroffip">CURLOPT_MAIL_RCPT</span> 
513
 
<p class="level1">Pass a pointer to a linked list of recipients to pass to the server in your SMTP mail request.  The linked list should be a fully valid list of <span class="bold">struct curl_slist</span> structs properly filled in. Use <a class="emphasis" href="./curl_slist_append.html">curl_slist_append(3)</a> to create the list and <a class="emphasis" href="./curl_slist_free_all.html">curl_slist_free_all(3)</a> to clean up an entire list. 
514
 
<p class="level1">Each recipient in SMTP lingo is specified with angle brackets (&lt;&gt;), but should you not use an angle bracket as first letter libcurl will assume you provide a single email address only and enclose that with angle brackets for you. 
515
 
<p class="level1">(Added in 7.20.0) <a name="TFTP"></a><h2 class="nroffsh">TFTP OPTIONS</h2>
 
520
<p class="level1">Pass a pointer to a linked list of recipients to pass to the server in your SMTP mail request. The linked list should be a fully valid list of <span class="bold">struct curl_slist</span> structs properly filled in. Use <a class="emphasis" href="./curl_slist_append.html">curl_slist_append(3)</a> to create the list and <a class="emphasis" href="./curl_slist_free_all.html">curl_slist_free_all(3)</a> to clean up an entire list. 
 
521
<p class="level1">Each recipient should be specified within a pair of angled brackets (&lt;&gt;), however, should you not use an angled bracket as the first character libcurl will assume you provided a single email address and enclose that address within brackets for you. 
 
522
<p class="level1">(Added in 7.20.0) 
 
523
<p class="level0"><a name="CURLOPTMAILAUTH"></a><span class="nroffip">CURLOPT_MAIL_AUTH</span> 
 
524
<p class="level1">Pass a pointer to a zero terminated string as parameter. This will be used to specify the authentication address (identity) of a submitted message that is being relayed to another server. 
 
525
<p class="level1">This optional parameter allows co-operating agents in a trusted environment to communicate the authentication of individual messages and should only be used by the application program, using libcurl, if the application is itself a mail server acting in such an environment. If the application is operating as such and the AUTH address is not known or is invalid, then an empty string should be used for this parameter. 
 
526
<p class="level1">Unlike CURLOPT_MAIL_FROM and CURLOPT_MAIL_RCPT, the address should not be specified within a pair of angled brackets (&lt;&gt;). However, if an empty string is used then a pair of brackets will be sent by libcurl as required by RFC-2554. 
 
527
<p class="level1">(Added in 7.24.0) <a name="TFTP"></a><h2 class="nroffsh">TFTP OPTIONS</h2>
516
528
<p class="level0">
517
529
<p class="level0"><a name="CURLOPTTFTPBLKSIZE"></a><span class="nroffip">CURLOPT_TFTP_BLKSIZE</span> 
518
530
<p class="level1">Specify block size to use for TFTP data transmission. Valid range as per RFC 2348 is 8-65464 bytes. The default of 512 bytes will be used if this option is not specified. The specified block size will only be used pending support by the remote server. If the server does not return an option acknowledgement or returns an option acknowledgement with no blksize, the default of 512 bytes will be used. (added in 7.19.4) <a name="FTP"></a><h2 class="nroffsh">FTP OPTIONS</h2>
532
544
<p class="level0"><a name="CURLOPTPOSTQUOTE"></a><span class="nroffip">CURLOPT_POSTQUOTE</span> 
533
545
<p class="level1">Pass a pointer to a linked list of FTP or SFTP commands to pass to the server after your FTP transfer request. The commands will only be run if no error occurred. The linked list should be a fully valid list of struct curl_slist structs properly filled in as described for <a class="emphasis" href="#CURLOPTQUOTE">CURLOPT_QUOTE</a>. Disable this operation again by setting a NULL to this option. 
534
546
<p class="level0"><a name="CURLOPTPREQUOTE"></a><span class="nroffip">CURLOPT_PREQUOTE</span> 
535
 
<p class="level1">Pass a pointer to a linked list of FTP commands to pass to the server after the transfer type is set. The linked list should be a fully valid list of struct curl_slist structs properly filled in as described for <a class="emphasis" href="#CURLOPTQUOTE">CURLOPT_QUOTE</a>. Disable this operation again by setting a NULL to this option. Before version 7.15.6, if you also set <a class="emphasis" href="#CURLOPTNOBODY">CURLOPT_NOBODY</a> to 1, this option didn't work. 
 
547
<p class="level1">Pass a pointer to a linked list of FTP commands to pass to the server after the transfer type is set. The linked list should be a fully valid list of struct curl_slist structs properly filled in as described for <a class="emphasis" href="#CURLOPTQUOTE">CURLOPT_QUOTE</a>. Disable this operation again by setting a NULL to this option. Before version 7.16.0, if you also set <a class="emphasis" href="#CURLOPTNOBODY">CURLOPT_NOBODY</a> to 1, this option didn't work. 
536
548
<p class="level0"><a name="CURLOPTDIRLISTONLY"></a><span class="nroffip">CURLOPT_DIRLISTONLY</span> 
537
549
<p class="level1">A parameter set to 1 tells the library to just list the names of files in a directory, instead of doing a full directory listing that would include file sizes, dates etc. This works for FTP and SFTP URLs. 
538
550
<p class="level1">This causes an FTP NLST command to be sent on an FTP server.  Beware that some FTP servers list only files in their response to NLST; they might not include subdirectories and symbolic links. 
603
615
<p class="level1"><a name="CURLRTSPREQDESCRIBE"></a><span class="nroffip">CURL_RTSPREQ_DESCRIBE</span> 
604
616
<p class="level2">Used to get the low level description of a stream. The application should note what formats it understands in the <span Class="emphasis">'Accept:'</span> header. Unless set manually, libcurl will automatically fill in <span class="emphasis">'Accept: application/sdp'</span>. Time-condition headers will be added to Describe requests if the <a class="emphasis" href="#CURLOPTTIMECONDITION">CURLOPT_TIMECONDITION</a> option is active. <span class="bold">(The session ID is not needed for this method)</span>  (Added in 7.20.0) 
605
617
<p class="level1"><a name="CURLRTSPREQANNOUNCE"></a><span class="nroffip">CURL_RTSPREQ_ANNOUNCE</span> 
606
 
<p class="level2">When sent by a client, this method changes the description of the session. For example, if a client is using the server to record a meeting, the client can use Announce to inform the server of all the meta-information about the session.  ANNOUNCE acts like an HTTP PUT or POST just like <a class="emphasis" href="#CURLRTSPREQSETPARAMETER">CURL_RTSPREQ_SET_PARAMETER</a> (Added in 7.20.0) 
 
618
<p class="level2">When sent by a client, this method changes the description of the session. For example, if a client is using the server to record a meeting, the client can use Announce to inform the server of all the meta-information about the session.  ANNOUNCE acts like a HTTP PUT or POST just like <a class="emphasis" href="#CURLRTSPREQSETPARAMETER">CURL_RTSPREQ_SET_PARAMETER</a> (Added in 7.20.0) 
607
619
<p class="level1"><a name="CURLRTSPREQSETUP"></a><span class="nroffip">CURL_RTSPREQ_SETUP</span> 
608
620
<p class="level2">Setup is used to initialize the transport layer for the session. The application must set the desired Transport options for a session by using the <a class="emphasis" href="#CURLOPTRTSPTRANSPORT">CURLOPT_RTSP_TRANSPORT</a> option prior to calling setup. If no session ID is currently set with <a class="emphasis" href="#CURLOPTRTSPSESSIONID">CURLOPT_RTSP_SESSION_ID</a>, libcurl will extract and use the session ID in the response to this request. <span class="bold">(The session ID is not needed for this method).</span>  (Added in 7.20.0) 
609
621
<p class="level1"><a name="CURLRTSPREQPLAY"></a><span class="nroffip">CURL_RTSPREQ_PLAY</span> 
613
625
<p class="level1"><a name="CURLRTSPREQTEARDOWN"></a><span class="nroffip">CURL_RTSPREQ_TEARDOWN</span> 
614
626
<p class="level2">This command terminates an RTSP session. Simply closing a connection does not terminate the RTSP session since it is valid to control an RTSP session over different connections.  (Added in 7.20.0) 
615
627
<p class="level1"><a name="CURLRTSPREQGETPARAMETER"></a><span class="nroffip">CURL_RTSPREQ_GET_PARAMETER</span> 
616
 
<p class="level2">Retrieve a parameter from the server. By default, libcurl will automatically include a <span Class="emphasis">Content-Type: text/parameters</span> header on all non-empty requests unless a custom one is set. GET_PARAMETER acts just like an HTTP PUT or POST (see <a class="emphasis" href="#CURLRTSPREQSETPARAMETER">CURL_RTSPREQ_SET_PARAMETER</a>). Applications wishing to send a heartbeat message (e.g. in the presence of a server-specified timeout) should send use an empty GET_PARAMETER request. (Added in 7.20.0) 
 
628
<p class="level2">Retrieve a parameter from the server. By default, libcurl will automatically include a <span Class="emphasis">Content-Type: text/parameters</span> header on all non-empty requests unless a custom one is set. GET_PARAMETER acts just like a HTTP PUT or POST (see <a class="emphasis" href="#CURLRTSPREQSETPARAMETER">CURL_RTSPREQ_SET_PARAMETER</a>). Applications wishing to send a heartbeat message (e.g. in the presence of a server-specified timeout) should send use an empty GET_PARAMETER request. (Added in 7.20.0) 
617
629
<p class="level1"><a name="CURLRTSPREQSETPARAMETER"></a><span class="nroffip">CURL_RTSPREQ_SET_PARAMETER</span> 
618
 
<p class="level2">Set a parameter on the server. By default, libcurl will automatically include a <span Class="emphasis">Content-Type: text/parameters</span> header unless a custom one is set. The interaction with SET_PARAMTER is much like an HTTP PUT or POST. An application may either use <a class="emphasis" href="#CURLOPTUPLOAD">CURLOPT_UPLOAD</a> with <a class="emphasis" href="#CURLOPTREADDATA">CURLOPT_READDATA</a> like an HTTP PUT, or it may use <a class="emphasis" href="#CURLOPTPOSTFIELDS">CURLOPT_POSTFIELDS</a> like an HTTP POST. No chunked transfers are allowed, so the application must set the <a class="emphasis" href="#CURLOPTINFILESIZE">CURLOPT_INFILESIZE</a> in the former and <a class="emphasis" href="#CURLOPTPOSTFIELDSIZE">CURLOPT_POSTFIELDSIZE</a> in the latter. Also, there is no use of multi-part POSTs within RTSP. (Added in 7.20.0) 
 
630
<p class="level2">Set a parameter on the server. By default, libcurl will automatically include a <span Class="emphasis">Content-Type: text/parameters</span> header unless a custom one is set. The interaction with SET_PARAMTER is much like a HTTP PUT or POST. An application may either use <a class="emphasis" href="#CURLOPTUPLOAD">CURLOPT_UPLOAD</a> with <a class="emphasis" href="#CURLOPTREADDATA">CURLOPT_READDATA</a> like a HTTP PUT, or it may use <a class="emphasis" href="#CURLOPTPOSTFIELDS">CURLOPT_POSTFIELDS</a> like a HTTP POST. No chunked transfers are allowed, so the application must set the <a class="emphasis" href="#CURLOPTINFILESIZE">CURLOPT_INFILESIZE</a> in the former and <a class="emphasis" href="#CURLOPTPOSTFIELDSIZE">CURLOPT_POSTFIELDSIZE</a> in the latter. Also, there is no use of multi-part POSTs within RTSP. (Added in 7.20.0) 
619
631
<p class="level1"><a name="CURLRTSPREQRECORD"></a><span class="nroffip">CURL_RTSPREQ_RECORD</span> 
620
632
<p class="level2">Used to tell the server to record a session. Use the <a class="emphasis" href="#CURLOPTRANGE">CURLOPT_RANGE</a> option to modify the record time. (Added in 7.20.0) 
621
633
<p class="level1"><a name="CURLRTSPREQRECEIVE"></a><span class="nroffip">CURL_RTSPREQ_RECEIVE</span> 
638
650
<p class="level1">A parameter set to 1 tells the library to use ASCII mode for FTP transfers, instead of the default binary transfer. For win32 systems it does not set the stdout to binary mode. This option can be usable when transferring text data between systems with different views on certain characters, such as newlines or similar. 
639
651
<p class="level1">libcurl does not do a complete ASCII conversion when doing ASCII transfers over FTP. This is a known limitation/flaw that nobody has rectified. libcurl simply sets the mode to ASCII and performs a standard transfer. 
640
652
<p class="level0"><a name="CURLOPTPROXYTRANSFERMODE"></a><span class="nroffip">CURLOPT_PROXY_TRANSFER_MODE</span> 
641
 
<p class="level1">Pass a long. If the value is set to 1 (one), it tells libcurl to set the transfer mode (binary or ASCII) for FTP transfers done via an HTTP proxy, by appending ;type=a or ;type=i to the URL. Without this setting, or it being set to 0 (zero, the default), <a class="emphasis" href="#CURLOPTTRANSFERTEXT">CURLOPT_TRANSFERTEXT</a> has no effect when doing FTP via a proxy. Beware that not all proxies support this feature.  (Added in 7.18.0) 
 
653
<p class="level1">Pass a long. If the value is set to 1 (one), it tells libcurl to set the transfer mode (binary or ASCII) for FTP transfers done via a HTTP proxy, by appending ;type=a or ;type=i to the URL. Without this setting, or it being set to 0 (zero, the default), <a class="emphasis" href="#CURLOPTTRANSFERTEXT">CURLOPT_TRANSFERTEXT</a> has no effect when doing FTP via a proxy. Beware that not all proxies support this feature.  (Added in 7.18.0) 
642
654
<p class="level0"><a name="CURLOPTCRLF"></a><span class="nroffip">CURLOPT_CRLF</span> 
643
655
<p class="level1">Pass a long. If the value is set to 1 (one), libcurl converts Unix newlines to CRLF newlines on transfers. Disable this option again by setting the value to 0 (zero). 
644
656
<p class="level0"><a name="CURLOPTRANGE"></a><span class="nroffip">CURLOPT_RANGE</span> 
651
663
<p class="level0"><a name="CURLOPTRESUMEFROMLARGE"></a><span class="nroffip">CURLOPT_RESUME_FROM_LARGE</span> 
652
664
<p class="level1">Pass a curl_off_t as parameter. It contains the offset in number of bytes that you want the transfer to start from. (Added in 7.11.0) 
653
665
<p class="level0"><a name="CURLOPTCUSTOMREQUEST"></a><span class="nroffip">CURLOPT_CUSTOMREQUEST</span> 
654
 
<p class="level1">Pass a pointer to a zero terminated string as parameter. It will be used instead of GET or HEAD when doing an HTTP request, or instead of LIST or NLST when doing a FTP directory listing. This is useful for doing DELETE or other more or less obscure HTTP requests. Don't do this at will, make sure your server supports the command first. 
 
666
<p class="level1">Pass a pointer to a zero terminated string as parameter. It will be used instead of GET or HEAD when doing a HTTP request, or instead of LIST or NLST when doing a FTP directory listing. This is useful for doing DELETE or other more or less obscure HTTP requests. Don't do this at will, make sure your server supports the command first. 
655
667
<p class="level1">When you change the request method by setting <a class="bold" href="#CURLOPTCUSTOMREQUEST">CURLOPT_CUSTOMREQUEST</a> to something, you don't actually change how libcurl behaves or acts in regards to the particular request method, it will only change the actual string sent in the request. 
656
668
<p class="level1">For example: if you tell libcurl to do a HEAD request, but then change the request to a "GET" with <a class="bold" href="#CURLOPTCUSTOMREQUEST">CURLOPT_CUSTOMREQUEST</a> you'll still see libcurl act as if it sent a HEAD even when it does send a GET. 
657
669
<p class="level1">To switch to a proper HEAD, use <a class="emphasis" href="#CURLOPTNOBODY">CURLOPT_NOBODY</a>, to switch to a proper POST, use <a class="emphasis" href="#CURLOPTPOST">CURLOPT_POST</a> or <a class="emphasis" href="#CURLOPTPOSTFIELDS">CURLOPT_POSTFIELDS</a> and so on. 
794
806
<p class="level0"><a name="CURLOPTSSLVERIFYPEER"></a><span class="nroffip">CURLOPT_SSL_VERIFYPEER</span> 
795
807
<p class="level1">Pass a long as parameter. By default, curl assumes a value of 1. 
796
808
<p class="level1">This option determines whether curl verifies the authenticity of the peer's certificate. A value of 1 means curl verifies; 0 (zero) means it doesn't. 
797
 
<p class="level1">When negotiating an SSL connection, the server sends a certificate indicating its identity.  Curl verifies whether the certificate is authentic, i.e. that you can trust that the server is who the certificate says it is.  This trust is based on a chain of digital signatures, rooted in certification authority (CA) certificates you supply.  curl uses a default bundle of CA certificates (the path for that is determined at build time) and you can specify alternate certificates with the <a class="emphasis" href="#CURLOPTCAINFO">CURLOPT_CAINFO</a> option or the <a class="emphasis" href="#CURLOPTCAPATH">CURLOPT_CAPATH</a> option. 
 
809
<p class="level1">When negotiating a SSL connection, the server sends a certificate indicating its identity.  Curl verifies whether the certificate is authentic, i.e. that you can trust that the server is who the certificate says it is.  This trust is based on a chain of digital signatures, rooted in certification authority (CA) certificates you supply.  curl uses a default bundle of CA certificates (the path for that is determined at build time) and you can specify alternate certificates with the <a class="emphasis" href="#CURLOPTCAINFO">CURLOPT_CAINFO</a> option or the <a class="emphasis" href="#CURLOPTCAPATH">CURLOPT_CAPATH</a> option. 
798
810
<p class="level1">When <a class="emphasis" href="#CURLOPTSSLVERIFYPEER">CURLOPT_SSL_VERIFYPEER</a> is nonzero, and the verification fails to prove that the certificate is authentic, the connection fails.  When the option is zero, the peer certificate verification succeeds regardless. 
799
811
<p class="level1">Authenticating the certificate is not by itself very useful.  You typically want to ensure that the server, as authentically identified by its certificate, is the server you mean to be talking to.  Use <a class="emphasis" href="#CURLOPTSSLVERIFYHOST">CURLOPT_SSL_VERIFYHOST</a> to control that. The check that the host name in the certificate is valid for the host name you're connecting to is done independently of the <a class="emphasis" href="#CURLOPTSSLVERIFYPEER">CURLOPT_SSL_VERIFYPEER</a> option. 
800
812
<p class="level0"><a name="CURLOPTCAINFO"></a><span class="nroffip">CURLOPT_CAINFO</span> 
838
850
<p class="level1">
839
851
<p class="level0"><a name="CURLOPTSSLSESSIONIDCACHE"></a><span class="nroffip">CURLOPT_SSL_SESSIONID_CACHE</span> 
840
852
<p class="level1">Pass a long set to 0 to disable libcurl's use of SSL session-ID caching. Set this to 1 to enable it. By default all transfers are done using the cache. While nothing ever should get hurt by attempting to reuse SSL session-IDs, there seem to be broken SSL implementations in the wild that may require you to disable this in order for you to succeed. (Added in 7.16.0) 
 
853
<p class="level0"><a name="CURLOPTSSLOPTIONS"></a><span class="nroffip">CURLOPT_SSL_OPTIONS</span> 
 
854
<p class="level1">Pass a long with a bitmask to tell libcurl about specific SSL behaviors. 
 
855
<p class="level1">CURLSSLOPT_ALLOW_BEAST is the only supported bit and by setting this the user will tell libcurl to not attempt to use any work-arounds for a security flaw in the SSL3 and TLS1.0 protocols.  If this option isn't used or this bit is set to 0, the SSL layer libcurl uses may use a work-around for this flaw although it might cause interoperability problems with some (older) SSL implementations. WARNING: avoiding this work-around loosens the security, and by setting this option to 1 you ask for exactly that. (Added in 7.25.0) 
841
856
<p class="level0"><a name="CURLOPTKRBLEVEL"></a><span class="nroffip">CURLOPT_KRBLEVEL</span> 
842
857
<p class="level1">Pass a char * as parameter. Set the kerberos security level for FTP; this also enables kerberos 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. Set the string to NULL to disable kerberos support for FTP. 
843
858
<p class="level1">(This option was known as CURLOPT_KRB4LEVEL up to 7.16.3) 
845
860
<p class="level1">Set the parameter to CURLGSSAPI_DELEGATION_FLAG to allow unconditional GSSAPI credential delegation.  The delegation is disabled by default since 7.21.7. Set the parameter to CURLGSSAPI_DELEGATION_POLICY_FLAG to delegate only if the OK-AS-DELEGATE flag is set in the service ticket in case this feature is supported by the GSSAPI implementation and the definition of GSS_C_DELEG_POLICY_FLAG was available at compile-time. (Added in 7.22.0) <a name="SSH"></a><h2 class="nroffsh">SSH OPTIONS</h2>
846
861
<p class="level0">
847
862
<p class="level0"><a name="CURLOPTSSHAUTHTYPES"></a><span class="nroffip">CURLOPT_SSH_AUTH_TYPES</span> 
848
 
<p class="level1">Pass a long set to a bitmask consisting of one or more of CURLSSH_AUTH_PUBLICKEY, CURLSSH_AUTH_PASSWORD, CURLSSH_AUTH_HOST, CURLSSH_AUTH_KEYBOARD. Set CURLSSH_AUTH_ANY to let libcurl pick one. (Added in 7.16.1) 
 
863
<p class="level1">Pass a long set to a bitmask consisting of one or more of CURLSSH_AUTH_PUBLICKEY, CURLSSH_AUTH_PASSWORD, CURLSSH_AUTH_HOST, CURLSSH_AUTH_KEYBOARD. Set CURLSSH_AUTH_ANY to let libcurl pick one. Currently CURLSSH_AUTH_HOST has no effect. (Added in 7.16.1) 
849
864
<p class="level0"><a name="CURLOPTSSHHOSTPUBLICKEYMD5"></a><span class="nroffip">CURLOPT_SSH_HOST_PUBLIC_KEY_MD5</span> 
850
865
<p class="level1">Pass a char * pointing to a string containing 32 hexadecimal digits. The string should be the 128 bit MD5 checksum of the remote host's public key, and libcurl will reject the connection to the host unless the md5sums match. This option is only for SCP and SFTP transfers. (Added in 7.17.1) 
851
866
<p class="level0"><a name="CURLOPTSSHPUBLICKEYFILE"></a><span class="nroffip">CURLOPT_SSH_PUBLIC_KEYFILE</span>