removed trailing whitespace
[platform/upstream/curl.git] / docs / libcurl / curl_easy_setopt.3
1 .\" **************************************************************************
2 .\" *                                  _   _ ____  _
3 .\" *  Project                     ___| | | |  _ \| |
4 .\" *                             / __| | | | |_) | |
5 .\" *                            | (__| |_| |  _ <| |___
6 .\" *                             \___|\___/|_| \_\_____|
7 .\" *
8 .\" * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
9 .\" *
10 .\" * This software is licensed as described in the file COPYING, which
11 .\" * you should have received as part of this distribution. The terms
12 .\" * are also available at http://curl.haxx.se/docs/copyright.html.
13 .\" *
14 .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 .\" * copies of the Software, and permit persons to whom the Software is
16 .\" * furnished to do so, under the terms of the COPYING file.
17 .\" *
18 .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 .\" * KIND, either express or implied.
20 .\" *
21 .\" * $Id$
22 .\" **************************************************************************
23 .\"
24 .TH curl_easy_setopt 3 "1 Jan 2010" "libcurl 7.20.0" "libcurl Manual"
25 .SH NAME
26 curl_easy_setopt \- set options for a curl easy handle
27 .SH SYNOPSIS
28 #include <curl/curl.h>
29
30 CURLcode curl_easy_setopt(CURL *handle, CURLoption option, parameter);
31 .SH DESCRIPTION
32 curl_easy_setopt() is used to tell libcurl how to behave. By using the
33 appropriate options to \fIcurl_easy_setopt\fP, you can change libcurl's
34 behavior.  All options are set with the \fIoption\fP followed by a
35 \fIparameter\fP. That parameter can be a \fBlong\fP, a \fBfunction pointer\fP,
36 an \fBobject pointer\fP or a \fBcurl_off_t\fP, depending on what the specific
37 option expects. Read this manual carefully as bad input values may cause
38 libcurl to behave badly!  You can only set one option in each function call. A
39 typical application uses many curl_easy_setopt() calls in the setup phase.
40
41 Options set with this function call are valid for all forthcoming transfers
42 performed using this \fIhandle\fP.  The options are not in any way reset
43 between transfers, so if you want subsequent transfers with different options,
44 you must change them between the transfers. You can optionally reset all
45 options back to internal default with \fIcurl_easy_reset(3)\fP.
46
47 Strings passed to libcurl as 'char *' arguments, are copied by the library;
48 thus the string storage associated to the pointer argument may be overwritten
49 after curl_easy_setopt() returns. Exceptions to this rule are described in
50 the option details below.
51
52 Before version 7.17.0, strings were not copied. Instead the user was forced
53 keep them available until libcurl no longer needed them.
54
55 The \fIhandle\fP is the return code from a \fIcurl_easy_init(3)\fP or
56 \fIcurl_easy_duphandle(3)\fP call.
57 .SH BEHAVIOR OPTIONS
58 .IP CURLOPT_VERBOSE
59 Set the parameter to 1 to get the library to display a lot of verbose
60 information about its operations. Very useful for libcurl and/or protocol
61 debugging and understanding. The verbose information will be sent to stderr,
62 or the stream set with \fICURLOPT_STDERR\fP.
63
64 You hardly ever want this set in production use, you will almost always want
65 this when you debug/report problems. Another neat option for debugging is the
66 \fICURLOPT_DEBUGFUNCTION\fP.
67 .IP CURLOPT_HEADER
68 A parameter set to 1 tells the library to include the header in the body
69 output. This is only relevant for protocols that actually have headers
70 preceding the data (like HTTP).
71 .IP CURLOPT_NOPROGRESS
72 A parameter set to 1 tells the library to shut off the built-in progress meter
73 completely.
74
75 Future versions of libcurl are likely to not have any built-in progress meter
76 at all.
77 .IP CURLOPT_NOSIGNAL
78 Pass a long. If it is 1, libcurl will not use any functions that
79 install signal handlers or any functions that cause signals to be sent to the
80 process. This option is mainly here to allow multi-threaded unix applications
81 to still set/use all timeout options etc, without risking getting signals.
82 (Added in 7.10)
83
84 If this option is set and libcurl has been built with the standard name
85 resolver, timeouts will not occur while the name resolve takes place.
86 Consider building libcurl with c-ares support to enable asynchronous DNS
87 lookups, which enables nice timeouts for name resolves without signals.
88 .PP
89 .SH CALLBACK OPTIONS
90 .IP CURLOPT_WRITEFUNCTION
91 Function pointer that should match the following prototype: \fBsize_t
92 function( void *ptr, size_t size, size_t nmemb, void *stream);\fP This
93 function gets called by libcurl as soon as there is data received that needs
94 to be saved. The size of the data pointed to by \fIptr\fP is \fIsize\fP
95 multiplied with \fInmemb\fP, it will not be zero terminated. Return the number
96 of bytes actually taken care of. If that amount differs from the amount passed
97 to your function, it'll signal an error to the library and it will abort the
98 transfer and return \fICURLE_WRITE_ERROR\fP.
99
100 From 7.18.0, the function can return CURL_WRITEFUNC_PAUSE which then will
101 cause writing to this connection to become paused. See
102 \fIcurl_easy_pause(3)\fP for further details.
103
104 This function may be called with zero bytes data if the transferred file is
105 empty.
106
107 Set this option to NULL to get the internal default function. The internal
108 default function will write the data to the FILE * given with
109 \fICURLOPT_WRITEDATA\fP.
110
111 Set the \fIstream\fP argument with the \fICURLOPT_WRITEDATA\fP option.
112
113 The callback function will be passed as much data as possible in all invokes,
114 but you cannot possibly make any assumptions. It may be one byte, it may be
115 thousands. The maximum amount of data that can be passed to the write callback
116 is defined in the curl.h header file: CURL_MAX_WRITE_SIZE.
117 .IP CURLOPT_WRITEDATA
118 Data pointer to pass to the file write function. If you use the
119 \fICURLOPT_WRITEFUNCTION\fP option, this is the pointer you'll get as
120 input. If you don't use a callback, you must pass a 'FILE *' as libcurl will
121 pass this to fwrite() when writing data.
122
123 The internal \fICURLOPT_WRITEFUNCTION\fP will write the data to the FILE *
124 given with this option, or to stdout if this option hasn't been set.
125
126 If you're using libcurl as a win32 DLL, you \fBMUST\fP use the
127 \fICURLOPT_WRITEFUNCTION\fP if you set this option or you will experience
128 crashes.
129
130 This option is also known with the older name \fICURLOPT_FILE\fP, the name
131 \fICURLOPT_WRITEDATA\fP was introduced in 7.9.7.
132 .IP CURLOPT_READFUNCTION
133 Function pointer that should match the following prototype: \fBsize_t
134 function( void *ptr, size_t size, size_t nmemb, void *stream);\fP This
135 function gets called by libcurl as soon as it needs to read data in order to
136 send it to the peer. The data area pointed at by the pointer \fIptr\fP may be
137 filled with at most \fIsize\fP multiplied with \fInmemb\fP number of
138 bytes. Your function must return the actual number of bytes that you stored in
139 that memory area. Returning 0 will signal end-of-file to the library and cause
140 it to stop the current transfer.
141
142 If you stop the current transfer by returning 0 "pre-maturely" (i.e before the
143 server expected it, like when you've said you will upload N bytes and you
144 upload less than N bytes), you may experience that the server "hangs" waiting
145 for the rest of the data that won't come.
146
147 The read callback may return \fICURL_READFUNC_ABORT\fP to stop the current
148 operation immediately, resulting in a \fICURLE_ABORTED_BY_CALLBACK\fP error
149 code from the transfer (Added in 7.12.1)
150
151 From 7.18.0, the function can return CURL_READFUNC_PAUSE which then will cause
152 reading from this connection to become paused. See \fIcurl_easy_pause(3)\fP
153 for further details.
154
155 If you set the callback pointer to NULL, or don't set it at all, the default
156 internal read function will be used. It is simply doing an fread() on the FILE
157 * stream set with \fICURLOPT_READDATA\fP.
158 .IP CURLOPT_READDATA
159 Data pointer to pass to the file read function. If you use the
160 \fICURLOPT_READFUNCTION\fP option, this is the pointer you'll get as input. If
161 you don't specify a read callback but instead rely on the default internal
162 read function, this data must be a valid readable FILE *.
163
164 If you're using libcurl as a win32 DLL, you MUST use a
165 \fICURLOPT_READFUNCTION\fP if you set this option.
166
167 This option was also known by the older name \fICURLOPT_INFILE\fP, the name
168 \fICURLOPT_READDATA\fP was introduced in 7.9.7.
169 .IP CURLOPT_IOCTLFUNCTION
170 Function pointer that should match the \fIcurl_ioctl_callback\fP prototype
171 found in \fI<curl/curl.h>\fP. This function gets called by libcurl when
172 something special I/O-related needs to be done that the library can't do by
173 itself. For now, rewinding the read data stream is the only action it can
174 request. The rewinding of the read data stream may be necessary when doing a
175 HTTP PUT or POST with a multi-pass authentication method.  (Option added in
176 7.12.3).
177
178 Use \fICURLOPT_SEEKFUNCTION\fP instead to provide seeking!
179 .IP CURLOPT_IOCTLDATA
180 Pass a pointer that will be untouched by libcurl and passed as the 3rd
181 argument in the ioctl callback set with \fICURLOPT_IOCTLFUNCTION\fP.  (Option
182 added in 7.12.3)
183 .IP CURLOPT_SEEKFUNCTION
184 Function pointer that should match the following prototype: \fIint
185 function(void *instream, curl_off_t offset, int origin);\fP This function gets
186 called by libcurl to seek to a certain position in the input stream and can be
187 used to fast forward a file in a resumed upload (instead of reading all
188 uploaded bytes with the normal read function/callback). It is also called to
189 rewind a stream when doing a HTTP PUT or POST with a multi-pass authentication
190 method. The function shall work like "fseek" or "lseek" and accepted SEEK_SET,
191 SEEK_CUR and SEEK_END as argument for origin, although (in 7.18.0) libcurl
192 only passes SEEK_SET. The callback must return 0 (CURL_SEEKFUNC_OK) on
193 success, 1 (CURL_SEEKFUNC_FAIL) to cause the upload operation to fail or 2
194 (CURL_SEEKFUNC_CANTSEEK) to indicate that while the seek failed, libcurl is
195 free to work around the problem if possible. The latter can sometimes be done
196 by instead reading from the input or similar.
197
198 If you forward the input arguments directly to "fseek" or "lseek", note that
199 the data type for \fIoffset\fP is not the same as defined for curl_off_t on
200 many systems! (Option added in 7.18.0)
201 .IP CURLOPT_SEEKDATA
202 Data pointer to pass to the file read function. If you use the
203 \fICURLOPT_SEEKFUNCTION\fP option, this is the pointer you'll get as input. If
204 you don't specify a seek callback, NULL is passed. (Option added in 7.18.0)
205 .IP CURLOPT_SOCKOPTFUNCTION
206 Function pointer that should match the \fIcurl_sockopt_callback\fP prototype
207 found in \fI<curl/curl.h>\fP. This function gets called by libcurl after the
208 socket() call but before the connect() call. The callback's \fIpurpose\fP
209 argument identifies the exact purpose for this particular socket, and
210 currently only one value is supported: \fICURLSOCKTYPE_IPCXN\fP for the
211 primary connection (meaning the control connection in the FTP case). Future
212 versions of libcurl may support more purposes. It passes the newly created
213 socket descriptor so additional setsockopt() calls can be done at the user's
214 discretion.  Return 0 (zero) from the callback on success. Return 1 from the
215 callback function to signal an unrecoverable error to the library and it will
216 close the socket and return \fICURLE_COULDNT_CONNECT\fP.  (Option added in
217 7.15.6.)
218 .IP CURLOPT_SOCKOPTDATA
219 Pass a pointer that will be untouched by libcurl and passed as the first
220 argument in the sockopt callback set with \fICURLOPT_SOCKOPTFUNCTION\fP.
221 (Option added in 7.15.6.)
222 .IP CURLOPT_OPENSOCKETFUNCTION
223 Function pointer that should match the \fIcurl_opensocket_callback\fP
224 prototype found in \fI<curl/curl.h>\fP. This function gets called by libcurl
225 instead of the \fIsocket(2)\fP call. The callback's \fIpurpose\fP argument
226 identifies the exact purpose for this particular socket, and currently only
227 one value is supported: \fICURLSOCKTYPE_IPCXN\fP for the primary connection
228 (meaning the control connection in the FTP case). Future versions of libcurl
229 may support more purposes. It passes the resolved peer address as a
230 \fIaddress\fP argument so the callback can modify the address or refuse to
231 connect at all. The callback function should return the socket or
232 \fICURL_SOCKET_BAD\fP in case no connection should be established or any error
233 detected. Any additional \fIsetsockopt(2)\fP calls can be done on the socket
234 at the user's discretion.  \fICURL_SOCKET_BAD\fP return value from the
235 callback function will signal an unrecoverable error to the library and it
236 will return \fICURLE_COULDNT_CONNECT\fP.  This return code can be used for IP
237 address blacklisting.  The default behavior is:
238 .nf
239    return socket(addr->family, addr->socktype, addr->protocol);
240 .fi
241 (Option added in 7.17.1.)
242 .IP CURLOPT_OPENSOCKETDATA
243 Pass a pointer that will be untouched by libcurl and passed as the first
244 argument in the opensocket callback set with \fICURLOPT_OPENSOCKETFUNCTION\fP.
245 (Option added in 7.17.1.)
246 .IP CURLOPT_PROGRESSFUNCTION
247 Function pointer that should match the \fIcurl_progress_callback\fP prototype
248 found in \fI<curl/curl.h>\fP. This function gets called by libcurl instead of
249 its internal equivalent with a frequent interval during operation (roughly
250 once per second) no matter if data is being transfered or not.  Unknown/unused
251 argument values passed to the callback will be set to zero (like if you only
252 download data, the upload size will remain 0). Returning a non-zero value from
253 this callback will cause libcurl to abort the transfer and return
254 \fICURLE_ABORTED_BY_CALLBACK\fP.
255
256 If you transfer data with the multi interface, this function will not be
257 called during periods of idleness unless you call the appropriate libcurl
258 function that performs transfers.
259
260 \fICURLOPT_NOPROGRESS\fP must be set to 0 to make this function actually
261 get called.
262 .IP CURLOPT_PROGRESSDATA
263 Pass a pointer that will be untouched by libcurl and passed as the first
264 argument in the progress callback set with \fICURLOPT_PROGRESSFUNCTION\fP.
265 .IP CURLOPT_HEADERFUNCTION
266 Function pointer that should match the following prototype: \fIsize_t
267 function( void *ptr, size_t size, size_t nmemb, void *stream);\fP. This
268 function gets called by libcurl as soon as it has received header data. The
269 header callback will be called once for each header and only complete header
270 lines are passed on to the callback. Parsing headers should be easy enough
271 using this. The size of the data pointed to by \fIptr\fP is \fIsize\fP
272 multiplied with \fInmemb\fP. Do not assume that the header line is zero
273 terminated! The pointer named \fIstream\fP is the one you set with the
274 \fICURLOPT_WRITEHEADER\fP option. The callback function must return the number
275 of bytes actually taken care of, or return -1 to signal error to the library
276 (it will cause it to abort the transfer with a \fICURLE_WRITE_ERROR\fP return
277 code).
278
279 If this option is not set, or if it is set to NULL, but
280 \fICURLOPT_HEADERDATA\fP (\fICURLOPT_WRITEHEADER\fP) is set to anything but
281 NULL, the function used to accept response data will be used instead. That is,
282 it will be the function specified with \fICURLOPT_WRITEFUNCTION\fP, or if it
283 is not specified or NULL - the default, stream-writing function.
284
285 It's important to note that the callback will be invoked for the headers of
286 all responses received after initiating a request and not just the final
287 response. This includes all responses which occur during authentication
288 negotiation. If you need to operate on only the headers from the final
289 response, you will need to collect headers in the callback yourself and use
290 HTTP status lines, for example, to delimit response boundaries.
291
292 Since 7.14.1: When a server sends a chunked encoded transfer, it may contain a
293 trailer. That trailer is identical to a HTTP header and if such a trailer is
294 received it is passed to the application using this callback as well. There
295 are several ways to detect it being a trailer and not an ordinary header: 1)
296 it comes after the response-body. 2) it comes after the final header line (CR
297 LF) 3) a Trailer: header among the response-headers mention what header to
298 expect in the trailer.
299 .IP CURLOPT_WRITEHEADER
300 (This option is also known as \fBCURLOPT_HEADERDATA\fP) Pass a pointer to be
301 used to write the header part of the received data to. If you don't use your
302 own callback to take care of the writing, this must be a valid FILE *. See
303 also the \fICURLOPT_HEADERFUNCTION\fP option above on how to set a custom
304 get-all-headers callback.
305 .IP CURLOPT_DEBUGFUNCTION
306 Function pointer that should match the following prototype: \fIint
307 curl_debug_callback (CURL *, curl_infotype, char *, size_t, void *);\fP
308 \fICURLOPT_DEBUGFUNCTION\fP replaces the standard debug function used when
309 \fICURLOPT_VERBOSE \fP is in effect. This callback receives debug information,
310 as specified with the \fBcurl_infotype\fP argument. This function must return
311 0.  The data pointed to by the char * passed to this function WILL NOT be zero
312 terminated, but will be exactly of the size as told by the size_t argument.
313
314 Available curl_infotype values:
315 .RS
316 .IP CURLINFO_TEXT
317 The data is informational text.
318 .IP CURLINFO_HEADER_IN
319 The data is header (or header-like) data received from the peer.
320 .IP CURLINFO_HEADER_OUT
321 The data is header (or header-like) data sent to the peer.
322 .IP CURLINFO_DATA_IN
323 The data is protocol data received from the peer.
324 .IP CURLINFO_DATA_OUT
325 The data is protocol data sent to the peer.
326 .RE
327 .IP CURLOPT_DEBUGDATA
328 Pass a pointer to whatever you want passed in to your
329 \fICURLOPT_DEBUGFUNCTION\fP in the last void * argument. This pointer is not
330 used by libcurl, it is only passed to the callback.
331 .IP CURLOPT_SSL_CTX_FUNCTION
332 This option does only function for libcurl powered by OpenSSL. If libcurl was
333 built against another SSL library, this functionality is absent.
334
335 Function pointer that should match the following prototype: \fBCURLcode
336 sslctxfun(CURL *curl, void *sslctx, void *parm);\fP This function gets called
337 by libcurl just before the initialization of an SSL connection after having
338 processed all other SSL related options to give a last chance to an
339 application to modify the behaviour of openssl's ssl initialization. The
340 \fIsslctx\fP parameter is actually a pointer to an openssl \fISSL_CTX\fP. If
341 an error is returned no attempt to establish a connection is made and the
342 perform operation will return the error code from this callback function.  Set
343 the \fIparm\fP argument with the \fICURLOPT_SSL_CTX_DATA\fP option. This
344 option was introduced in 7.11.0.
345
346 This function will get called on all new connections made to a server, during
347 the SSL negotiation. The SSL_CTX pointer will be a new one every time.
348
349 To use this properly, a non-trivial amount of knowledge of the openssl
350 libraries is necessary. For example, using this function allows you to use
351 openssl callbacks to add additional validation code for certificates, and even
352 to change the actual URI of an HTTPS request (example used in the lib509 test
353 case).  See also the example section for a replacement of the key, certificate
354 and trust file settings.
355 .IP CURLOPT_SSL_CTX_DATA
356 Data pointer to pass to the ssl context callback set by the option
357 \fICURLOPT_SSL_CTX_FUNCTION\fP, this is the pointer you'll get as third
358 parameter, otherwise \fBNULL\fP. (Added in 7.11.0)
359 .IP CURLOPT_CONV_TO_NETWORK_FUNCTION
360 .IP CURLOPT_CONV_FROM_NETWORK_FUNCTION
361 .IP CURLOPT_CONV_FROM_UTF8_FUNCTION
362 Function pointers that should match the following prototype: CURLcode
363 function(char *ptr, size_t length);
364
365 These three options apply to non-ASCII platforms only.  They are available
366 only if \fBCURL_DOES_CONVERSIONS\fP was defined when libcurl was built. When
367 this is the case, \fIcurl_version_info(3)\fP will return the CURL_VERSION_CONV
368 feature bit set.
369
370 The data to be converted is in a buffer pointed to by the ptr parameter.  The
371 amount of data to convert is indicated by the length parameter.  The converted
372 data overlays the input data in the buffer pointed to by the ptr parameter.
373 CURLE_OK should be returned upon successful conversion.  A CURLcode return
374 value defined by curl.h, such as CURLE_CONV_FAILED, should be returned if an
375 error was encountered.
376
377 \fBCURLOPT_CONV_TO_NETWORK_FUNCTION\fP and
378 \fBCURLOPT_CONV_FROM_NETWORK_FUNCTION\fP convert between the host encoding and
379 the network encoding.  They are used when commands or ASCII data are
380 sent/received over the network.
381
382 \fBCURLOPT_CONV_FROM_UTF8_FUNCTION\fP is called to convert from UTF8 into the
383 host encoding.  It is required only for SSL processing.
384
385 If you set a callback pointer to NULL, or don't set it at all, the built-in
386 libcurl iconv functions will be used.  If HAVE_ICONV was not defined when
387 libcurl was built, and no callback has been established, conversion will
388 return the CURLE_CONV_REQD error code.
389
390 If HAVE_ICONV is defined, CURL_ICONV_CODESET_OF_HOST must also be defined.
391 For example:
392
393  \&#define CURL_ICONV_CODESET_OF_HOST "IBM-1047"
394
395 The iconv code in libcurl will default the network and UTF8 codeset names as
396 follows:
397
398  \&#define CURL_ICONV_CODESET_OF_NETWORK "ISO8859-1"
399
400  \&#define CURL_ICONV_CODESET_FOR_UTF8   "UTF-8"
401
402 You will need to override these definitions if they are different on your
403 system.
404 .IP CURLOPT_INTERLEAVEFUNCTION
405 Function pointer that should match the following prototype: \fIsize_t
406 function( void *ptr, size_t size, size_t nmemb, void *stream)\fP. This
407 function gets called by libcurl as soon as it has received interleaved RTP
408 data. This function gets called for each $ block and therefore contains
409 exactly one upper-layer protocol unit (e.g.  one RTP packet). Curl writes the
410 interleaved header as well as the included data for each call. The first byte
411 is always an ASCII dollar sign. The dollar sign is followed by a one byte
412 channel identifier and then a 2 byte integer length in network byte order. See
413 \fIRFC 2326 Section 10.12\fP for more information on how RTP interleaving
414 behaves. If unset or set to NULL, curl will use the default write function.
415
416 Interleaved RTP poses some challeneges for the client application. Since the
417 stream data is sharing the RTSP control connection, it is critical to service
418 the RTP in a timely fashion. If the RTP data is not handled quickly,
419 subsequent response processing may become unreasonably delayed and the
420 connection may close. The application may use \fICURL_RTSPREQ_RECEIVE\fP to
421 service RTP data when no requests are desired. If the application makes a
422 request, (e.g.  \fICURL_RTSPREQ_PAUSE\fP) then the response handler will
423 process any pending RTP data before marking the request as finished.  (Added
424 in 7.20.0)
425 .IP CURLOPT_INTERLEAVEDATA
426 This is the stream that will be passed to \fICURLOPT_INTERLEAVEFUNCTION\fP when
427 interleaved RTP data is received. (Added in 7.20.0)
428 .SH ERROR OPTIONS
429 .IP CURLOPT_ERRORBUFFER
430 Pass a char * to a buffer that the libcurl may store human readable error
431 messages in. This may be more helpful than just the return code from
432 \fIcurl_easy_perform\fP. The buffer must be at least CURL_ERROR_SIZE big.
433 Although this argument is a 'char *', it does not describe an input string.
434 Therefore the (probably undefined) contents of the buffer is NOT copied
435 by the library. You should keep the associated storage available until
436 libcurl no longer needs it. Failing to do so will cause very odd behavior
437 or even crashes. libcurl will need it until you call \fIcurl_easy_cleanup(3)\fP
438 or you set the same option again to use a different pointer.
439
440 Use \fICURLOPT_VERBOSE\fP and \fICURLOPT_DEBUGFUNCTION\fP to better
441 debug/trace why errors happen.
442
443 If the library does not return an error, the buffer may not have been
444 touched. Do not rely on the contents in those cases.
445
446 .IP CURLOPT_STDERR
447 Pass a FILE * as parameter. Tell libcurl to use this stream instead of stderr
448 when showing the progress meter and displaying \fICURLOPT_VERBOSE\fP data.
449 .IP CURLOPT_FAILONERROR
450 A parameter set to 1 tells the library to fail silently if the HTTP code
451 returned is equal to or larger than 400. The default action would be to return
452 the page normally, ignoring that code.
453
454 This method is not fail-safe and there are occasions where non-successful
455 response codes will slip through, especially when authentication is involved
456 (response codes 401 and 407).
457
458 You might get some amounts of headers transferred before this situation is
459 detected, like when a "100-continue" is received as a response to a
460 POST/PUT and a 401 or 407 is received immediately afterwards.
461 .SH NETWORK OPTIONS
462 .IP CURLOPT_URL
463 The actual URL to deal with. The parameter should be a char * to a zero
464 terminated string.
465
466 If the given URL lacks the protocol part ("http://" or "ftp://" etc), it will
467 attempt to guess which protocol to use based on the given host name. If the
468 given protocol of the set URL is not supported, libcurl will return on error
469 (\fICURLE_UNSUPPORTED_PROTOCOL\fP) when you call \fIcurl_easy_perform(3)\fP or
470 \fIcurl_multi_perform(3)\fP. Use \fIcurl_version_info(3)\fP for detailed info
471 on which protocols are supported.
472
473 The string given to CURLOPT_URL must be url-encoded and follow RFC 2396
474 (http://curl.haxx.se/rfc/rfc2396.txt).
475
476 Starting with version 7.20.0, the fragment part of the URI will not be send as
477 part of the path, which was the case previously.
478
479 \fICURLOPT_URL\fP is the only option that \fBmust\fP be set before
480 \fIcurl_easy_perform(3)\fP is called.
481
482 \fICURLOPT_PROTOCOLS\fP can be used to limit what protocols libcurl will use
483 for this transfer, independent of what libcurl has been compiled to
484 support. That may be useful if you accept the URL from an external source and
485 want to limit the accessibility.
486 .IP CURLOPT_PROTOCOLS
487 Pass a long that holds a bitmask of CURLPROTO_* defines. If used, this bitmask
488 limits what protocols libcurl may use in the transfer. This allows you to have
489 a libcurl built to support a wide range of protocols but still limit specific
490 transfers to only be allowed to use a subset of them. By default libcurl will
491 accept all protocols it supports. See also
492 \fICURLOPT_REDIR_PROTOCOLS\fP. (Added in 7.19.4)
493 .IP CURLOPT_REDIR_PROTOCOLS
494 Pass a long that holds a bitmask of CURLPROTO_* defines. If used, this bitmask
495 limits what protocols libcurl may use in a transfer that it follows to in a
496 redirect when \fICURLOPT_FOLLOWLOCATION\fP is enabled. This allows you to
497 limit specific transfers to only be allowed to use a subset of protocols in
498 redirections. By default libcurl will allow all protocols except for FILE and
499 SCP. This is a difference compared to pre-7.19.4 versions which
500 unconditionally would follow to all protocols supported. (Added in 7.19.4)
501 .IP CURLOPT_PROXY
502 Set HTTP proxy to use. The parameter should be a char * to a zero terminated
503 string holding the host name or dotted IP address. To specify port number in
504 this string, append :[port] to the end of the host name. The proxy string may
505 be prefixed with [protocol]:// since any such prefix will be ignored. The
506 proxy's port number may optionally be specified with the separate option. If
507 not specified, libcurl will default to using port 1080 for proxies.
508 \fICURLOPT_PROXYPORT\fP.
509
510 When you tell the library to use an HTTP proxy, libcurl will transparently
511 convert operations to HTTP even if you specify an FTP URL etc. This may have
512 an impact on what other features of the library you can use, such as
513 \fICURLOPT_QUOTE\fP and similar FTP specifics that don't work unless you
514 tunnel through the HTTP proxy. Such tunneling is activated with
515 \fICURLOPT_HTTPPROXYTUNNEL\fP.
516
517 libcurl respects the environment variables \fBhttp_proxy\fP, \fBftp_proxy\fP,
518 \fBall_proxy\fP etc, if any of those are set. The \fICURLOPT_PROXY\fP option
519 does however override any possibly set environment variables.
520
521 Setting the proxy string to "" (an empty string) will explicitly disable the
522 use of a proxy, even if there is an environment variable set for it.
523
524 Since 7.14.1, the proxy host string given in environment variables can be
525 specified the exact same way as the proxy can be set with \fICURLOPT_PROXY\fP,
526 include protocol prefix (http://) and embedded user + password.
527 .IP CURLOPT_PROXYPORT
528 Pass a long with this option to set the proxy port to connect to unless it is
529 specified in the proxy string \fICURLOPT_PROXY\fP.
530 .IP CURLOPT_PROXYTYPE
531 Pass a long with this option to set type of the proxy. Available options for
532 this are \fICURLPROXY_HTTP\fP, \fICURLPROXY_HTTP_1_0\fP (added in 7.19.4),
533 \fICURLPROXY_SOCKS4\fP (added in 7.15.2), \fICURLPROXY_SOCKS5\fP,
534 \fICURLPROXY_SOCKS4A\fP (added in 7.18.0) and \fICURLPROXY_SOCKS5_HOSTNAME\fP
535 (added in 7.18.0). The HTTP type is default. (Added in 7.10)
536 .IP CURLOPT_NOPROXY
537 Pass a pointer to a zero terminated string. The should be a comma- separated
538 list of hosts which do not use a proxy, if one is specified.  The only
539 wildcard is a single * character, which matches all hosts, and effectively
540 disables the proxy. Each name in this list is matched as either a domain which
541 contains the hostname, or the hostname itself. For example, local.com would
542 match local.com, local.com:80, and www.local.com, but not www.notlocal.com.
543 (Added in 7.19.4)
544 .IP CURLOPT_HTTPPROXYTUNNEL
545 Set the parameter to 1 to make the library tunnel all operations through a
546 given HTTP proxy. There is a big difference between using a proxy and to
547 tunnel through it. If you don't know what this means, you probably don't want
548 this tunneling option.
549 .IP CURLOPT_SOCKS5_GSSAPI_SERVICE
550 Pass a char * as parameter to a string holding the name of the service. The
551 default service name for a SOCKS5 server is rcmd/server-fqdn. This option
552 allows you to change it. (Added in 7.19.4)
553 .IP CURLOPT_SOCKS5_GSSAPI_NEC
554 Pass a long set to 1 to enable or 0 to disable. As part of the gssapi
555 negotiation a protection mode is negotiated. The rfc1961 says in section
556 4.3/4.4 it should be protected, but the NEC reference implementation does not.
557 If enabled, this option allows the unprotected exchange of the protection mode
558 negotiation. (Added in 7.19.4).
559 .IP CURLOPT_INTERFACE
560 Pass a char * as parameter. This sets the interface name to use as outgoing
561 network interface. The name can be an interface name, an IP address, or a host
562 name.
563 .IP CURLOPT_LOCALPORT
564 Pass a long. This sets the local port number of the socket used for
565 connection. This can be used in combination with \fICURLOPT_INTERFACE\fP and
566 you are recommended to use \fICURLOPT_LOCALPORTRANGE\fP as well when this is
567 set. Valid port numbers are 1 - 65535. (Added in 7.15.2)
568 .IP CURLOPT_LOCALPORTRANGE
569 Pass a long. This is the number of attempts libcurl should make to find a
570 working local port number. It starts with the given \fICURLOPT_LOCALPORT\fP
571 and adds one to the number for each retry. Setting this to 1 or below will
572 make libcurl do only one try for the exact port number. Port numbers by nature
573 are scarce resources that will be busy at times so setting this value to
574 something too low might cause unnecessary connection setup failures. (Added in
575 7.15.2)
576 .IP CURLOPT_DNS_CACHE_TIMEOUT
577 Pass a long, this sets the timeout in seconds. Name resolves will be kept in
578 memory for this number of seconds. Set to zero to completely disable
579 caching, or set to -1 to make the cached entries remain forever. By default,
580 libcurl caches this info for 60 seconds.
581
582 The name resolve functions of various libc implementations don't re-read name
583 server information unless explicitly told so (for example, by calling
584 \fIres_init(3)\fP). This may cause libcurl to keep using the older server even
585 if DHCP has updated the server info, and this may look like a DNS cache issue
586 to the casual libcurl-app user.
587 .IP CURLOPT_DNS_USE_GLOBAL_CACHE
588 Pass a long. If the value is 1, it tells curl to use a global DNS cache
589 that will survive between easy handle creations and deletions. This is not
590 thread-safe and this will use a global variable.
591
592 \fBWARNING:\fP this option is considered obsolete. Stop using it. Switch over
593 to using the share interface instead! See \fICURLOPT_SHARE\fP and
594 \fIcurl_share_init(3)\fP.
595 .IP CURLOPT_BUFFERSIZE
596 Pass a long specifying your preferred size (in bytes) for the receive buffer
597 in libcurl.  The main point of this would be that the write callback gets
598 called more often and with smaller chunks. This is just treated as a request,
599 not an order. You cannot be guaranteed to actually get the given size. (Added
600 in 7.10)
601
602 This size is by default set as big as possible (CURL_MAX_WRITE_SIZE), so it
603 only makes sense to use this option if you want it smaller.
604 .IP CURLOPT_PORT
605 Pass a long specifying what remote port number to connect to, instead of the
606 one specified in the URL or the default port for the used protocol.
607 .IP CURLOPT_TCP_NODELAY
608 Pass a long specifying whether the TCP_NODELAY option should be set or
609 cleared (1 = set, 0 = clear). The option is cleared by default. This
610 will have no effect after the connection has been established.
611
612 Setting this option will disable TCP's Nagle algorithm. The purpose of
613 this algorithm is to try to minimize the number of small packets on
614 the network (where "small packets" means TCP segments less than the
615 Maximum Segment Size (MSS) for the network).
616
617 Maximizing the amount of data sent per TCP segment is good because it
618 amortizes the overhead of the send. However, in some cases (most
619 notably telnet or rlogin) small segments may need to be sent
620 without delay. This is less efficient than sending larger amounts of
621 data at a time, and can contribute to congestion on the network if
622 overdone.
623 .IP CURLOPT_ADDRESS_SCOPE
624 Pass a long specifying the scope_id value to use when connecting to IPv6
625 link-local or site-local addresses. (Added in 7.19.0)
626 .SH NAMES and PASSWORDS OPTIONS (Authentication)
627 .IP CURLOPT_NETRC
628 This parameter controls the preference of libcurl between using user names and
629 passwords from your \fI~/.netrc\fP file, relative to user names and passwords
630 in the URL supplied with \fICURLOPT_URL\fP.
631
632 libcurl uses a user name (and supplied or prompted password) supplied with
633 \fICURLOPT_USERPWD\fP in preference to any of the options controlled by this
634 parameter.
635
636 Pass a long, set to one of the values described below.
637 .RS
638 .IP CURL_NETRC_OPTIONAL
639 The use of your \fI~/.netrc\fP file is optional, and information in the URL is
640 to be preferred.  The file will be scanned for the host and user name (to
641 find the password only) or for the host only, to find the first user name and
642 password after that \fImachine\fP, which ever information is not specified in
643 the URL.
644
645 Undefined values of the option will have this effect.
646 .IP CURL_NETRC_IGNORED
647 The library will ignore the file and use only the information in the URL.
648
649 This is the default.
650 .IP CURL_NETRC_REQUIRED
651 This value tells the library that use of the file is required, to ignore the
652 information in the URL, and to search the file for the host only.
653 .RE
654 Only machine name, user name and password are taken into account
655 (init macros and similar things aren't supported).
656
657 libcurl does not verify that the file has the correct properties set (as the
658 standard Unix ftp client does). It should only be readable by user.
659 .IP CURLOPT_NETRC_FILE
660 Pass a char * as parameter, pointing to a zero terminated string containing
661 the full path name to the file you want libcurl to use as .netrc file. If this
662 option is omitted, and \fICURLOPT_NETRC\fP is set, libcurl will attempt to
663 find a .netrc file in the current user's home directory. (Added in 7.10.9)
664 .IP CURLOPT_USERPWD
665 Pass a char * as parameter, which should be [user name]:[password] to use for
666 the connection. Use \fICURLOPT_HTTPAUTH\fP to decide the authentication method.
667
668 When using NTLM, you can set the domain by prepending it to the user name and
669 separating the domain and name with a forward (/) or backward slash (\\). Like
670 this: "domain/user:password" or "domain\\user:password". Some HTTP servers (on
671 Windows) support this style even for Basic authentication.
672
673 When using HTTP and \fICURLOPT_FOLLOWLOCATION\fP, libcurl might perform
674 several requests to possibly different hosts. libcurl will only send this user
675 and password information to hosts using the initial host name (unless
676 \fICURLOPT_UNRESTRICTED_AUTH\fP is set), so if libcurl follows locations to
677 other hosts it will not send the user and password to those. This is enforced
678 to prevent accidental information leakage.
679 .IP CURLOPT_PROXYUSERPWD
680 Pass a char * as parameter, which should be [user name]:[password] to use for
681 the connection to the HTTP proxy.  Use \fICURLOPT_PROXYAUTH\fP to decide
682 the authentication method.
683 .IP CURLOPT_USERNAME
684 Pass a char * as parameter, which should be pointing to the zero terminated
685 user name to use for the transfer.
686
687 \fBCURLOPT_USERNAME\fP sets the user name to be used in protocol
688 authentication. You should not use this option together with the (older)
689 CURLOPT_USERPWD option.
690
691 In order to specify the password to be used in conjunction with the user name
692 use the \fICURLOPT_PASSWORD\fP option.  (Added in 7.19.1)
693 .IP CURLOPT_PASSWORD
694 Pass a char * as parameter, which should be pointing to the zero terminated
695 password to use for the transfer.
696
697 The CURLOPT_PASSWORD option should be used in conjunction with
698 the \fICURLOPT_USERNAME\fP option. (Added in 7.19.1)
699 .IP CURLOPT_PROXYUSERNAME
700 Pass a char * as parameter, which should be pointing to the zero terminated
701 user name to use for the transfer while connecting to Proxy.
702
703 The CURLOPT_PROXYUSERNAME option should be used in same way as the
704 \fICURLOPT_PROXYUSERPWD\fP is used.  In comparison to
705 \fICURLOPT_PROXYUSERPWD\fP the CURLOPT_PROXYUSERNAME allows the username to
706 contain a colon, like in the following example: "sip:user@example.com". The
707 CURLOPT_PROXYUSERNAME option is an alternative way to set the user name while
708 connecting to Proxy.  There is no meaning to use it together with the
709 \fICURLOPT_PROXYUSERPWD\fP option.
710
711 In order to specify the password to be used in conjunction with the user name
712 use the \fICURLOPT_PROXYPASSWORD\fP option.  (Added in 7.19.1)
713 .IP CURLOPT_PROXYPASSWORD
714 Pass a char * as parameter, which should be pointing to the zero terminated
715 password to use for the transfer while connecting to Proxy.
716
717 The CURLOPT_PROXYPASSWORD option should be used in conjunction with
718 the \fICURLOPT_PROXYUSERNAME\fP option. (Added in 7.19.1)
719 .IP CURLOPT_HTTPAUTH
720 Pass a long as parameter, which is set to a bitmask, to tell libcurl which
721 authentication method(s) you want it to use. The available bits are listed
722 below. If more than one bit is set, libcurl will first query the site to see
723 which authentication methods it supports and then pick the best one you allow
724 it to use. For some methods, this will induce an extra network round-trip. Set
725 the actual name and password with the \fICURLOPT_USERPWD\fP option or
726 with the \fICURLOPT_USERNAME\fP and the \fICURLOPT_USERPASSWORD\fP options.
727 (Added in 7.10.6)
728 .RS
729 .IP CURLAUTH_BASIC
730 HTTP Basic authentication. This is the default choice, and the only method
731 that is in wide-spread use and supported virtually everywhere. This sends
732 the user name and password over the network in plain text, easily captured by
733 others.
734 .IP CURLAUTH_DIGEST
735 HTTP Digest authentication.  Digest authentication is defined in RFC2617 and
736 is a more secure way to do authentication over public networks than the
737 regular old-fashioned Basic method.
738 .IP CURLAUTH_DIGEST_IE
739 HTTP Digest authentication with an IE flavor.  Digest authentication is
740 defined in RFC2617 and is a more secure way to do authentication over public
741 networks than the regular old-fashioned Basic method. The IE flavor is simply
742 that libcurl will use a special "quirk" that IE is known to have used before
743 version 7 and that some servers require the client to use. (This define was
744 added in 7.19.3)
745 .IP CURLAUTH_GSSNEGOTIATE
746 HTTP GSS-Negotiate authentication. The GSS-Negotiate (also known as plain
747 \&"Negotiate") method was designed by Microsoft and is used in their web
748 applications. It is primarily meant as a support for Kerberos5 authentication
749 but may also be used along with other authentication methods. For more
750 information see IETF draft draft-brezak-spnego-http-04.txt.
751
752 You need to build libcurl with a suitable GSS-API library for this to work.
753 .IP CURLAUTH_NTLM
754 HTTP NTLM authentication. A proprietary protocol invented and used by
755 Microsoft. It uses a challenge-response and hash concept similar to Digest, to
756 prevent the password from being eavesdropped.
757
758 You need to build libcurl with OpenSSL support for this option to work, or
759 build libcurl on Windows.
760 .IP CURLAUTH_ANY
761 This is a convenience macro that sets all bits and thus makes libcurl pick any
762 it finds suitable. libcurl will automatically select the one it finds most
763 secure.
764 .IP CURLAUTH_ANYSAFE
765 This is a convenience macro that sets all bits except Basic and thus makes
766 libcurl pick any it finds suitable. libcurl will automatically select the one
767 it finds most secure.
768 .RE
769 .IP CURLOPT_PROXYAUTH
770 Pass a long as parameter, which is set to a bitmask, to tell libcurl which
771 authentication method(s) you want it to use for your proxy authentication.  If
772 more than one bit is set, libcurl will first query the site to see what
773 authentication methods it supports and then pick the best one you allow it to
774 use. For some methods, this will induce an extra network round-trip. Set the
775 actual name and password with the \fICURLOPT_PROXYUSERPWD\fP option. The
776 bitmask can be constructed by or'ing together the bits listed above for the
777 \fICURLOPT_HTTPAUTH\fP option. As of this writing, only Basic, Digest and NTLM
778 work. (Added in 7.10.7)
779 .SH HTTP OPTIONS
780 .IP CURLOPT_AUTOREFERER
781 Pass a parameter set to 1 to enable this. When enabled, libcurl will
782 automatically set the Referer: field in requests where it follows a Location:
783 redirect.
784 .IP CURLOPT_ENCODING
785 Sets the contents of the Accept-Encoding: header sent in an HTTP request, and
786 enables decoding of a response when a Content-Encoding: header is received.
787 Three encodings are supported: \fIidentity\fP, which does nothing,
788 \fIdeflate\fP which requests the server to compress its response using the
789 zlib algorithm, and \fIgzip\fP which requests the gzip algorithm.  If a
790 zero-length string is set, then an Accept-Encoding: header containing all
791 supported encodings is sent.
792
793 This is a request, not an order; the server may or may not do it.  This option
794 must be set (to any non-NULL value) or else any unsolicited encoding done by
795 the server is ignored. See the special file lib/README.encoding for details.
796 .IP CURLOPT_FOLLOWLOCATION
797 A parameter set to 1 tells the library to follow any Location: header that the
798 server sends as part of an HTTP header.
799
800 This means that the library will re-send the same request on the new location
801 and follow new Location: headers all the way until no more such headers are
802 returned. \fICURLOPT_MAXREDIRS\fP can be used to limit the number of redirects
803 libcurl will follow.
804
805 Since 7.19.4, libcurl can limit what protocols it will automatically
806 follow. The accepted protocols are set with \fICURLOPT_REDIR_PROTOCOLS\fP and
807 it excludes the FILE protocol by default.
808 .IP CURLOPT_UNRESTRICTED_AUTH
809 A parameter set to 1 tells the library it can continue to send authentication
810 (user+password) when following locations, even when hostname changed. This
811 option is meaningful only when setting \fICURLOPT_FOLLOWLOCATION\fP.
812 .IP CURLOPT_MAXREDIRS
813 Pass a long. The set number will be the redirection limit. If that many
814 redirections have been followed, the next redirect will cause an error
815 (\fICURLE_TOO_MANY_REDIRECTS\fP). This option only makes sense if the
816 \fICURLOPT_FOLLOWLOCATION\fP is used at the same time. Added in 7.15.1:
817 Setting the limit to 0 will make libcurl refuse any redirect. Set it to -1 for
818 an infinite number of redirects (which is the default)
819 .IP CURLOPT_POSTREDIR
820 Pass a bitmask to control how libcurl acts on redirects after POSTs that get a
821 301 or 302 response back.  A parameter with bit 0 set (value
822 \fBCURL_REDIR_POST_301\fP) tells the library to respect RFC 2616/10.3.2 and
823 not convert POST requests into GET requests when following a 301
824 redirection. Setting bit 1 (value CURL_REDIR_POST_302) makes libcurl maintain
825 the request method after a 302 redirect. CURL_REDIR_POST_ALL is a convenience
826 define that sets both bits.
827
828 The non-RFC behaviour is ubiquitous in web browsers, so the library does the
829 conversion by default to maintain consistency. However, a server may require a
830 POST to remain a POST after such a redirection. This option is meaningful only
831 when setting \fICURLOPT_FOLLOWLOCATION\fP.  (Added in 7.17.1) (This option was
832 known as CURLOPT_POST301 up to 7.19.0 as it only supported the 301 way before
833 then)
834 .IP CURLOPT_PUT
835 A parameter set to 1 tells the library to use HTTP PUT to transfer data. The
836 data should be set with \fICURLOPT_READDATA\fP and \fICURLOPT_INFILESIZE\fP.
837
838 This option is deprecated and starting with version 7.12.1 you should instead
839 use \fICURLOPT_UPLOAD\fP.
840 .IP CURLOPT_POST
841 A parameter set to 1 tells the library to do a regular HTTP post. This will
842 also make the library use a "Content-Type:
843 application/x-www-form-urlencoded" header. (This is by far the most commonly
844 used POST method).
845
846 Use one of \fICURLOPT_POSTFIELDS\fP or \fICURLOPT_COPYPOSTFIELDS\fP options to
847 specify what data to post and \fICURLOPT_POSTFIELDSIZE\fP or
848 \fICURLOPT_POSTFIELDSIZE_LARGE\fP to set the data size.
849
850 Optionally, you can provide data to POST using the \fICURLOPT_READFUNCTION\fP
851 and \fICURLOPT_READDATA\fP options but then you must make sure to not set
852 \fICURLOPT_POSTFIELDS\fP to anything but NULL. When providing data with a
853 callback, you must transmit it using chunked transfer-encoding or you must set
854 the size of the data with the \fICURLOPT_POSTFIELDSIZE\fP or
855 \fICURLOPT_POSTFIELDSIZE_LARGE\fP option. To enable chunked encoding, you
856 simply pass in the appropriate Transfer-Encoding header, see the
857 post-callback.c example.
858
859 You can override the default POST Content-Type: header by setting your own
860 with \fICURLOPT_HTTPHEADER\fP.
861
862 Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header.
863 You can disable this header with \fICURLOPT_HTTPHEADER\fP as usual.
864
865 If you use POST to a HTTP 1.1 server, you can send data without knowing the
866 size before starting the POST if you use chunked encoding. You enable this by
867 adding a header like "Transfer-Encoding: chunked" with
868 \fICURLOPT_HTTPHEADER\fP. With HTTP 1.0 or without chunked transfer, you must
869 specify the size in the request.
870
871 When setting \fICURLOPT_POST\fP to 1, it will automatically set
872 \fICURLOPT_NOBODY\fP to 0 (since 7.14.1).
873
874 If you issue a POST request and then want to make a HEAD or GET using the same
875 re-used handle, you must explicitly set the new request type using
876 \fICURLOPT_NOBODY\fP or \fICURLOPT_HTTPGET\fP or similar.
877 .IP CURLOPT_POSTFIELDS
878 Pass a void * as parameter, which should be the full data to post in an HTTP
879 POST operation. You must make sure that the data is formatted the way you want
880 the server to receive it. libcurl will not convert or encode it for you. Most
881 web servers will assume this data to be url-encoded.
882
883 The pointed data are NOT copied by the library: as a consequence, they must
884 be preserved by the calling application until the transfer finishes.
885
886 This POST is a normal application/x-www-form-urlencoded kind (and libcurl will
887 set that Content-Type by default when this option is used), which is the most
888 commonly used one by HTML forms. See also the \fICURLOPT_POST\fP. Using
889 \fICURLOPT_POSTFIELDS\fP implies \fICURLOPT_POST\fP.
890
891 If you want to do a zero-byte POST, you need to set
892 \fICURLOPT_POSTFIELDSIZE\fP explicitly to zero, as simply setting
893 \fICURLOPT_POSTFIELDS\fP to NULL or "" just effectively disables the sending
894 of the specified string. libcurl will instead assume that you'll send the POST
895 data using the read callback!
896
897 Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header.
898 You can disable this header with \fICURLOPT_HTTPHEADER\fP as usual.
899
900 To make multipart/formdata posts (aka RFC2388-posts), check out the
901 \fICURLOPT_HTTPPOST\fP option.
902 .IP CURLOPT_POSTFIELDSIZE
903 If you want to post data to the server without letting libcurl do a strlen()
904 to measure the data size, this option must be used. When this option is used
905 you can post fully binary data, which otherwise is likely to fail. If this
906 size is set to -1, the library will use strlen() to get the size.
907 .IP CURLOPT_POSTFIELDSIZE_LARGE
908 Pass a curl_off_t as parameter. Use this to set the size of the
909 \fICURLOPT_POSTFIELDS\fP data to prevent libcurl from doing strlen() on the
910 data to figure out the size. This is the large file version of the
911 \fICURLOPT_POSTFIELDSIZE\fP option. (Added in 7.11.1)
912 .IP CURLOPT_COPYPOSTFIELDS
913 Pass a char * as parameter, which should be the full data to post in an HTTP
914 POST operation. It behaves as the \fICURLOPT_POSTFIELDS\fP option, but the
915 original data are copied by the library, allowing the application to overwrite
916 the original data after setting this option.
917
918 Because data are copied, care must be taken when using this option in
919 conjunction with \fICURLOPT_POSTFIELDSIZE\fP or
920 \fICURLOPT_POSTFIELDSIZE_LARGE\fP: If the size has not been set prior to
921 \fICURLOPT_COPYPOSTFIELDS\fP, the data are assumed to be a NUL-terminated
922 string; else the stored size informs the library about the data byte count to
923 copy. In any case, the size must not be changed after
924 \fICURLOPT_COPYPOSTFIELDS\fP, unless another \fICURLOPT_POSTFIELDS\fP or
925 \fICURLOPT_COPYPOSTFIELDS\fP option is issued.
926 (Added in 7.17.1)
927 .IP CURLOPT_HTTPPOST
928 Tells libcurl you want a multipart/formdata HTTP POST to be made and you
929 instruct what data to pass on to the server.  Pass a pointer to a linked list
930 of curl_httppost structs as parameter.  The easiest way to create such a
931 list, is to use \fIcurl_formadd(3)\fP as documented. The data in this list
932 must remain intact until you close this curl handle again with
933 \fIcurl_easy_cleanup(3)\fP.
934
935 Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header.
936 You can disable this header with \fICURLOPT_HTTPHEADER\fP as usual.
937
938 When setting \fICURLOPT_HTTPPOST\fP, it will automatically set
939 \fICURLOPT_NOBODY\fP to 0 (since 7.14.1).
940 .IP CURLOPT_REFERER
941 Pass a pointer to a zero terminated string as parameter. It will be used to
942 set the Referer: header in the http request sent to the remote server. This
943 can be used to fool servers or scripts. You can also set any custom header
944 with \fICURLOPT_HTTPHEADER\fP.
945 .IP CURLOPT_USERAGENT
946 Pass a pointer to a zero terminated string as parameter. It will be used to
947 set the User-Agent: header in the http request sent to the remote server. This
948 can be used to fool servers or scripts. You can also set any custom header
949 with \fICURLOPT_HTTPHEADER\fP.
950 .IP CURLOPT_HTTPHEADER
951 Pass a pointer to a linked list of HTTP headers to pass to the server in your
952 HTTP request. The linked list should be a fully valid list of \fBstruct
953 curl_slist\fP structs properly filled in. Use \fIcurl_slist_append(3)\fP to
954 create the list and \fIcurl_slist_free_all(3)\fP to clean up an entire
955 list. If you add a header that is otherwise generated and used by libcurl
956 internally, your added one will be used instead. If you add a header with no
957 content as in 'Accept:' (no data on the right side of the colon), the
958 internally used header will get disabled. Thus, using this option you can add
959 new headers, replace internal headers and remove internal headers. To add a
960 header with no content, make the content be two quotes: \&"". The headers
961 included in the linked list must not be CRLF-terminated, because curl adds
962 CRLF after each header item. Failure to comply with this will result in
963 strange bugs because the server will most likely ignore part of the headers
964 you specified.
965
966 The first line in a request (containing the method, usually a GET or POST) is
967 not a header and cannot be replaced using this option. Only the lines
968 following the request-line are headers. Adding this method line in this list
969 of headers will only cause your request to send an invalid header.
970
971 Pass a NULL to this to reset back to no custom headers.
972
973 The most commonly replaced headers have "shortcuts" in the options
974 \fICURLOPT_COOKIE\fP, \fICURLOPT_USERAGENT\fP and \fICURLOPT_REFERER\fP.
975 .IP CURLOPT_HTTP200ALIASES
976 Pass a pointer to a linked list of aliases to be treated as valid HTTP 200
977 responses.  Some servers respond with a custom header response line.  For
978 example, IceCast servers respond with "ICY 200 OK".  By including this string
979 in your list of aliases, the response will be treated as a valid HTTP header
980 line such as "HTTP/1.0 200 OK". (Added in 7.10.3)
981
982 The linked list should be a fully valid list of struct curl_slist structs, and
983 be properly filled in.  Use \fIcurl_slist_append(3)\fP to create the list and
984 \fIcurl_slist_free_all(3)\fP to clean up an entire list.
985
986 The alias itself is not parsed for any version strings. Before libcurl 7.16.3,
987 Libcurl used the value set by option \fICURLOPT_HTTP_VERSION\fP, but starting
988 with 7.16.3 the protocol is assumed to match HTTP 1.0 when an alias matched.
989 .IP CURLOPT_COOKIE
990 Pass a pointer to a zero terminated string as parameter. It will be used to
991 set a cookie in the http request. The format of the string should be
992 NAME=CONTENTS, where NAME is the cookie name and CONTENTS is what the cookie
993 should contain.
994
995 If you need to set multiple cookies, you need to set them all using a single
996 option and thus you need to concatenate them all in one single string. Set
997 multiple cookies in one string like this: "name1=content1; name2=content2;"
998 etc.
999
1000 This option sets the cookie header explictly in the outgoing request(s). If
1001 multiple requests are done due to authentication, followed redirections or
1002 similar, they will all get this cookie passed on.
1003
1004 Using this option multiple times will only make the latest string override the
1005 previous ones.
1006 .IP CURLOPT_COOKIEFILE
1007 Pass a pointer to a zero terminated string as parameter. It should contain the
1008 name of your file holding cookie data to read. The cookie data may be in
1009 Netscape / Mozilla cookie data format or just regular HTTP-style headers
1010 dumped to a file.
1011
1012 Given an empty or non-existing file or by passing the empty string (""), this
1013 option will enable cookies for this curl handle, making it understand and
1014 parse received cookies and then use matching cookies in future requests.
1015
1016 If you use this option multiple times, you just add more files to read.
1017 Subsequent files will add more cookies.
1018 .IP CURLOPT_COOKIEJAR
1019 Pass a file name as char *, zero terminated. This will make libcurl write all
1020 internally known cookies to the specified file when \fIcurl_easy_cleanup(3)\fP
1021 is called. If no cookies are known, no file will be created. Specify "-" to
1022 instead have the cookies written to stdout. Using this option also enables
1023 cookies for this session, so if you for example follow a location it will make
1024 matching cookies get sent accordingly.
1025
1026 If the cookie jar file can't be created or written to (when the
1027 \fIcurl_easy_cleanup(3)\fP is called), libcurl will not and cannot report an
1028 error for this. Using \fICURLOPT_VERBOSE\fP or \fICURLOPT_DEBUGFUNCTION\fP
1029 will get a warning to display, but that is the only visible feedback you get
1030 about this possibly lethal situation.
1031 .IP CURLOPT_COOKIESESSION
1032 Pass a long set to 1 to mark this as a new cookie "session". It will force
1033 libcurl to ignore all cookies it is about to load that are "session cookies"
1034 from the previous session. By default, libcurl always stores and loads all
1035 cookies, independent if they are session cookies or not. Session cookies are
1036 cookies without expiry date and they are meant to be alive and existing for
1037 this "session" only.
1038 .IP CURLOPT_COOKIELIST
1039 Pass a char * to a cookie string. Cookie can be either in Netscape / Mozilla
1040 format or just regular HTTP-style header (Set-Cookie: ...) format. If cURL
1041 cookie engine was not enabled it will enable its cookie engine.  Passing a
1042 magic string \&"ALL" will erase all cookies known by cURL. (Added in 7.14.1)
1043 Passing the special string \&"SESS" will only erase all session cookies known
1044 by cURL. (Added in 7.15.4) Passing the special string \&"FLUSH" will write
1045 all cookies known by cURL to the file specified by \fICURLOPT_COOKIEJAR\fP.
1046 (Added in 7.17.1)
1047 .IP CURLOPT_HTTPGET
1048 Pass a long. If the long is 1, this forces the HTTP request to get back
1049 to GET. Usable if a POST, HEAD, PUT, or a custom request has been used
1050 previously using the same curl handle.
1051
1052 When setting \fICURLOPT_HTTPGET\fP to 1, it will automatically set
1053 \fICURLOPT_NOBODY\fP to 0 (since 7.14.1).
1054 .IP CURLOPT_HTTP_VERSION
1055 Pass a long, set to one of the values described below. They force libcurl to
1056 use the specific HTTP versions. This is not sensible to do unless you have a
1057 good reason.
1058 .RS
1059 .IP CURL_HTTP_VERSION_NONE
1060 We don't care about what version the library uses. libcurl will use whatever
1061 it thinks fit.
1062 .IP CURL_HTTP_VERSION_1_0
1063 Enforce HTTP 1.0 requests.
1064 .IP CURL_HTTP_VERSION_1_1
1065 Enforce HTTP 1.1 requests.
1066 .RE
1067 .IP CURLOPT_IGNORE_CONTENT_LENGTH
1068 Ignore the Content-Length header. This is useful for Apache 1.x (and similar
1069 servers) which will report incorrect content length for files over 2
1070 gigabytes. If this option is used, curl will not be able to accurately report
1071 progress, and will simply stop the download when the server ends the
1072 connection. (added in 7.14.1)
1073 .IP CURLOPT_HTTP_CONTENT_DECODING
1074 Pass a long to tell libcurl how to act on content decoding. If set to zero,
1075 content decoding will be disabled. If set to 1 it is enabled. Libcurl has no
1076 default content decoding but requires you to use \fICURLOPT_ENCODING\fP for
1077 that. (added in 7.16.2)
1078 .IP CURLOPT_HTTP_TRANSFER_DECODING
1079 Pass a long to tell libcurl how to act on transfer decoding. If set to zero,
1080 transfer decoding will be disabled, if set to 1 it is enabled
1081 (default). libcurl does chunked transfer decoding by default unless this
1082 option is set to zero. (added in 7.16.2)
1083 .SH SMTP OPTIONS
1084 .IP CURLOPT_MAIL_FROM
1085 Pass a pointer to a zero terminated string as parameter. It will be used to
1086 specify the sender address in a mail when sending an SMTP mail with libcurl.
1087
1088 (Added in 7.20.0)
1089 .IP CURLOPT_MAIL_RCPT
1090 Pass a pointer to a linked list of recipients to pass to the server in your
1091 SMTP mail request.  The linked list should be a fully valid list of \fBstruct
1092 curl_slist\fP structs properly filled in. Use \fIcurl_slist_append(3)\fP to
1093 create the list and \fIcurl_slist_free_all(3)\fP to clean up an entire list.
1094
1095 (Added in 7.20.0)
1096 .SH TFTP OPTIONS
1097 .IP CURLOPT_TFTP_BLKSIZE
1098 Specify block size to use for TFTP data transmission. Valid range as per RFC
1099 2348 is 8-65464 bytes. The default of 512 bytes will be used if this option is
1100 not specified. The specified block size will only be used pending support by
1101 the remote server. If the server does not return an option acknowledgement or
1102 returns an option acknowledgement with no blksize, the default of 512 bytes
1103 will be used. (added in 7.19.4)
1104 .SH FTP OPTIONS
1105 .IP CURLOPT_FTPPORT
1106 Pass a pointer to a zero terminated string as parameter. It will be used to
1107 get the IP address to use for the FTP PORT instruction. The PORT instruction
1108 tells the remote server to connect to our specified IP address. The string may
1109 be a plain IP address, a host name, a network interface name (under Unix) or
1110 just a '-' symbol to let the library use your system's default IP
1111 address. Default FTP operations are passive, and thus won't use PORT.
1112
1113 The address can be followed by a ':' to specify a port, optionally followed by
1114 a '-' to specify a port range.  If the port specified is 0, the operating
1115 system will pick a free port.  If a range is provided and all ports in the
1116 range are not available, libcurl will report CURLE_FTP_PORT_FAILED for the
1117 handle.  Invalid port/range settings are ignored.  IPv6 addresses followed by
1118 a port or portrange have to be in brackets.  IPv6 addresses without port/range
1119 specifier can be in brackets.  (added in 7.19.5)
1120
1121 Examples with specified ports:
1122
1123 .nf
1124   eth0:0
1125   192.168.1.2:32000-33000
1126   curl.se:32123
1127   [::1]:1234-4567
1128 .fi
1129
1130 You disable PORT again and go back to using the passive version by setting
1131 this option to NULL.
1132 .IP CURLOPT_QUOTE
1133 Pass a pointer to a linked list of FTP or SFTP commands to pass to
1134 the server prior to your FTP request. This will be done before any
1135 other commands are issued (even before the CWD command for FTP). The
1136 linked list should be a fully valid list of 'struct curl_slist' structs
1137 properly filled in with text strings. Use \fIcurl_slist_append(3)\fP
1138 to append strings (commands) to the list, and clear the entire list
1139 afterwards with \fIcurl_slist_free_all(3)\fP. Disable this operation
1140 again by setting a NULL to this option.
1141 The set of valid FTP commands depends on the server (see RFC959 for a
1142 list of mandatory commands).
1143 The valid SFTP commands are: chgrp, chmod, chown, ln, mkdir, pwd,
1144 rename, rm, rmdir, symlink (see
1145 .BR curl (1))
1146 (SFTP support added in 7.16.3)
1147 .IP CURLOPT_POSTQUOTE
1148 Pass a pointer to a linked list of FTP or SFTP commands to pass to the server
1149 after your FTP transfer request. The commands will only be run if no error
1150 occurred. The linked list should be a fully valid list of struct curl_slist
1151 structs properly filled in as described for \fICURLOPT_QUOTE\fP. Disable this
1152 operation again by setting a NULL to this option.
1153 .IP CURLOPT_PREQUOTE
1154 Pass a pointer to a linked list of FTP commands to pass to the server after
1155 the transfer type is set. The linked list should be a fully valid list of
1156 struct curl_slist structs properly filled in as described for
1157 \fICURLOPT_QUOTE\fP. Disable this operation again by setting a NULL to this
1158 option. Before version 7.15.6, if you also set \fICURLOPT_NOBODY\fP to 1, this
1159 option didn't work.
1160 .IP CURLOPT_DIRLISTONLY
1161 A parameter set to 1 tells the library to just list the names of files in a
1162 directory, instead of doing a full directory listing that would include file
1163 sizes, dates etc. This works for FTP and SFTP URLs.
1164
1165 This causes an FTP NLST command to be sent on an FTP server.  Beware
1166 that some FTP servers list only files in their response to NLST; they
1167 might not include subdirectories and symbolic links.
1168
1169 (This option was known as CURLOPT_FTPLISTONLY up to 7.16.4)
1170 .IP CURLOPT_APPEND
1171 A parameter set to 1 tells the library to append to the remote file instead of
1172 overwrite it. This is only useful when uploading to an FTP site.
1173
1174 (This option was known as CURLOPT_FTPAPPEND up to 7.16.4)
1175 .IP CURLOPT_FTP_USE_EPRT
1176 Pass a long. If the value is 1, it tells curl to use the EPRT (and
1177 LPRT) command when doing active FTP downloads (which is enabled by
1178 \fICURLOPT_FTPPORT\fP). Using EPRT means that it will first attempt to use
1179 EPRT and then LPRT before using PORT, but if you pass zero to this
1180 option, it will not try using EPRT or LPRT, only plain PORT. (Added in 7.10.5)
1181
1182 If the server is an IPv6 host, this option will have no effect as of 7.12.3.
1183 .IP CURLOPT_FTP_USE_EPSV
1184 Pass a long. If the value is 1, it tells curl to use the EPSV command
1185 when doing passive FTP downloads (which it always does by default). Using EPSV
1186 means that it will first attempt to use EPSV before using PASV, but if you
1187 pass zero to this option, it will not try using EPSV, only plain PASV.
1188
1189 If the server is an IPv6 host, this option will have no effect as of 7.12.3.
1190 .IP CURLOPT_FTP_USE_PRET
1191 Pass a long. If the value is 1, it tells curl to send a PRET command before
1192 PASV (and EPSV). Certain FTP servers, mainly drftpd, require this non-standard
1193 command for directory listings as well as up and downloads in PASV mode. Has
1194 no effect when using the active FTP transfers mode.  (Added in 7.20.0)
1195 .IP CURLOPT_FTP_CREATE_MISSING_DIRS
1196 Pass a long. If the value is 1, curl will attempt to create any remote
1197 directory that it fails to CWD into. CWD is the command that changes working
1198 directory. (Added in 7.10.7)
1199
1200 This setting also applies to SFTP-connections. curl will attempt to create
1201 the remote directory if it can't obtain a handle to the target-location. The
1202 creation will fail if a file of the same name as the directory to create
1203 already exists or lack of permissions prevents creation. (Added in 7.16.3)
1204
1205 Starting with 7.19.4, you can also set this value to 2, which will make
1206 libcurl retry the CWD command again if the subsequent MKD command fails. This
1207 is especially useful if you're doing many simultanoes connections against the
1208 same server and they all have this option enabled, as then CWD may first fail
1209 but then another connection does MKD before this connection and thus MKD fails
1210 but trying CWD works! 7.19.4 also introduced the \fICURLFTP_CREATE_DIR\fP and
1211 \fICURLFTP_CREATE_DIR_RETRY\fP enum names for these arguments.
1212
1213 Before version 7.19.4, libcurl will simply ignore arguments set to 2 and act
1214 as if 1 was selected.
1215 .IP CURLOPT_FTP_RESPONSE_TIMEOUT
1216 Pass a long.  Causes curl to set a timeout period (in seconds) on the amount
1217 of time that the server is allowed to take in order to generate a response
1218 message for a command before the session is considered hung.  While curl is
1219 waiting for a response, this value overrides \fICURLOPT_TIMEOUT\fP. It is
1220 recommended that if used in conjunction with \fICURLOPT_TIMEOUT\fP, you set
1221 \fICURLOPT_FTP_RESPONSE_TIMEOUT\fP to a value smaller than
1222 \fICURLOPT_TIMEOUT\fP.  (Added in 7.10.8)
1223 .IP CURLOPT_FTP_ALTERNATIVE_TO_USER
1224 Pass a char * as parameter, pointing to a string which will be used to
1225 authenticate if the usual FTP "USER user" and "PASS password" negotiation
1226 fails. This is currently only known to be required when connecting to
1227 Tumbleweed's Secure Transport FTPS server using client certificates for
1228 authentication. (Added in 7.15.5)
1229 .IP CURLOPT_FTP_SKIP_PASV_IP
1230 Pass a long. If set to 1, it instructs libcurl to not use the IP address the
1231 server suggests in its 227-response to libcurl's PASV command when libcurl
1232 connects the data connection. Instead libcurl will re-use the same IP address
1233 it already uses for the control connection. But it will use the port number
1234 from the 227-response. (Added in 7.14.2)
1235
1236 This option has no effect if PORT, EPRT or EPSV is used instead of PASV.
1237 .IP CURLOPT_USE_SSL
1238 Pass a long using one of the values from below, to make libcurl use your
1239 desired level of SSL for the FTP transfer. (Added in 7.11.0)
1240
1241 (This option was known as CURLOPT_FTP_SSL up to 7.16.4, and the constants
1242 were known as CURLFTPSSL_*)
1243 .RS
1244 .IP CURLUSESSL_NONE
1245 Don't attempt to use SSL.
1246 .IP CURLUSESSL_TRY
1247 Try using SSL, proceed as normal otherwise.
1248 .IP CURLUSESSL_CONTROL
1249 Require SSL for the control connection or fail with \fICURLE_USE_SSL_FAILED\fP.
1250 .IP CURLUSESSL_ALL
1251 Require SSL for all communication or fail with \fICURLE_USE_SSL_FAILED\fP.
1252 .RE
1253 .IP CURLOPT_FTPSSLAUTH
1254 Pass a long using one of the values from below, to alter how libcurl issues
1255 \&"AUTH TLS" or "AUTH SSL" when FTP over SSL is activated (see
1256 \fICURLOPT_USE_SSL\fP). (Added in 7.12.2)
1257 .RS
1258 .IP CURLFTPAUTH_DEFAULT
1259 Allow libcurl to decide.
1260 .IP CURLFTPAUTH_SSL
1261 Try "AUTH SSL" first, and only if that fails try "AUTH TLS".
1262 .IP CURLFTPAUTH_TLS
1263 Try "AUTH TLS" first, and only if that fails try "AUTH SSL".
1264 .RE
1265 .IP CURLOPT_FTP_SSL_CCC
1266 If enabled, this option makes libcurl use CCC (Clear Command Channel). It
1267 shuts down the SSL/TLS layer after authenticating. The rest of the
1268 control channel communication will be unencrypted. This allows NAT routers
1269 to follow the FTP transaction. Pass a long using one of the values below.
1270 (Added in 7.16.1)
1271 .RS
1272 .IP CURLFTPSSL_CCC_NONE
1273 Don't attempt to use CCC.
1274 .IP CURLFTPSSL_CCC_PASSIVE
1275 Do not initiate the shutdown, but wait for the server to do it. Do not send
1276 a reply.
1277 .IP CURLFTPSSL_CCC_ACTIVE
1278 Initiate the shutdown and wait for a reply.
1279 .RE
1280 .IP CURLOPT_FTP_ACCOUNT
1281 Pass a pointer to a zero-terminated string (or NULL to disable). When an FTP
1282 server asks for "account data" after user name and password has been provided,
1283 this data is sent off using the ACCT command. (Added in 7.13.0)
1284 .IP CURLOPT_FTP_FILEMETHOD
1285 Pass a long that should have one of the following values. This option controls
1286 what method libcurl should use to reach a file on a FTP(S) server. The
1287 argument should be one of the following alternatives:
1288 .RS
1289 .IP CURLFTPMETHOD_MULTICWD
1290 libcurl does a single CWD operation for each path part in the given URL. For
1291 deep hierarchies this means many commands. This is how RFC1738 says it
1292 should be done. This is the default but the slowest behavior.
1293 .IP CURLFTPMETHOD_NOCWD
1294 libcurl does no CWD at all. libcurl will do SIZE, RETR, STOR etc and give a
1295 full path to the server for all these commands. This is the fastest behavior.
1296 .IP CURLFTPMETHOD_SINGLECWD
1297 libcurl does one CWD with the full target directory and then operates on the
1298 file \&"normally" (like in the multicwd case). This is somewhat more standards
1299 compliant than 'nocwd' but without the full penalty of 'multicwd'.
1300 .RE
1301 (Added in 7.15.1)
1302 .SH RTSP OPTIONS
1303 .IP CURLOPT_RTSP_REQUEST
1304 Tell libcurl what kind of RTSP request to make. Pass one of the following RTSP
1305 enum values. Unless noted otherwise, commands require the Session ID to be
1306 initialized. (Added in 7.20.0)
1307 .RS
1308 .IP CURL_RTSPREQ_OPTIONS
1309 Used to retrieve the available methods of the server. The application is
1310 responsbile for parsing and obeying the response. \fB(The session ID is not
1311 needed for this method.)\fP  (Added in 7.20.0)
1312 .IP CURL_RTSPREQ_DESCRIBE
1313 Used to get the low level description of a stream. The application should note
1314 what formats it understands in the \fI'Accept:'\fP header. Unless set
1315 manually, libcurl will automatically fill in \fI'Accept:
1316 application/sdp'\fP. Time-condition headers will be added to Describe requests
1317 if the \fICURLOPT_TIMECONDITION\fP option is active. \fB(The session ID is not
1318 needed for this method)\fP  (Added in 7.20.0)
1319 .IP CURL_RTSPREQ_ANNOUNCE
1320 When sent by a client, this method changes the description of the session. For
1321 example, if a client is using the server to record a meeting, the client can
1322 use Announce to inform the server of all the meta-information about the
1323 session.  ANNOUNCE acts like an HTTP PUT or POST just like
1324 \fICURL_RTSPREQ_SET_PARAMETER\fP (Added in 7.20.0)
1325 .IP CURL_RTSPREQ_SETUP
1326 Setup is used to initialize the transport layer for the session. The
1327 application must set the desired Transport options for a session by using the
1328 \fICURLOPT_RTSP_TRANSPORT\fP option prior to calling setup. If no session ID
1329 is currently set with \fICURLOPT_RTSP_SESSION_ID\fP, libcurl will extract and
1330 use the session ID in the response to this request. \fB(The session ID is not
1331 needed for this method).\fP  (Added in 7.20.0)
1332 .IP CURL_RTSPREQ_PLAY
1333 Send a Play command to the server. Use the \fICURLOPT_RANGE\fP option to
1334 modify the playback time (e.g. 'npt=10-15').  (Added in 7.20.0)
1335 .IP CURL_RTSPREQ_PAUSE
1336 Send a Pause command to the server. Use the \fICURLOPT_RANGE\fP option with a
1337 single value to indicate when the stream should be halted. (e.g. npt='25')
1338 (Added in 7.20.0)
1339 .IP CURL_RTSPREQ_TEARDOWN
1340 This command terminates an RTSP session. Simply closing a connection does not
1341 terminate the RTSP session since it is valid to control an RTSP session over
1342 different connections.  (Added in 7.20.0)
1343 .IP CURL_RTSPREQ_GET_PARAMETER
1344 Retrieve a parameter from the server. By default, libcurl will automatically
1345 include an \fIAccept: text/parameters\fP header unless a custom one is set.
1346 Applications wishing to send a heartbeat message (e.g. in the presence of a
1347 server-specified timeout) should send use an empty GET_PARAMETER request.
1348 (Added in 7.20.0)
1349 .IP CURL_RTSPREQ_SET_PARAMETER
1350 Set a parameter on the server. By default, libcurl will automatically include
1351 a \fIContent-Type: text/parameters\fP header unless a custom one is set. The
1352 interaction with SET_PARAMTER is much like an HTTP PUT or POST. An application
1353 may either use \fICURLOPT_UPLOAD\fP with \fICURLOPT_READDATA\fP like an HTTP
1354 PUT, or it may use \fICURLOPT_POSTFIELDS\fP like an HTTP POST. No chunked
1355 transfers are allowed, so the application must set the
1356 \fICURLOPT_INFILESIZE\fP in the former and \fICURLOPT_POSTFIELDSIZE\fP in the
1357 latter. Also, there is no use of multi-part POSTs within RTSP. (Added in
1358 7.20.0)
1359 .IP CURL_RTSPREQ_RECORD
1360 Used to tell the server to record a session. Use the \fICURLOPT_RANGE\fP
1361 option to modify the record time. (Added in 7.20.0)
1362 .IP CURL_RTSPREQ_RECEIVE
1363 This is a special request because it does not send any data to the server. The
1364 application may call this function in order to receive interleaved RTP
1365 data. It will return after processing one read buffer of data in order to give
1366 the application a chance to run. (Added in 7.20.0)
1367 .RE
1368 .IP CURLOPT_RTSP_SESSION_ID
1369 Pass a char * as a parameter to set the value of the current RTSP Session ID
1370 for the handle. Useful for resuming an in-progress session. Once this value is
1371 set to any non-NULL value, libcurl will return \fICURLE_RTSP_SESSION_ERROR\fP
1372 if ID received from the server does not match. If unset (or set to NULL),
1373 libcurl will automatically set the ID the first time the server sets it in a
1374 response. (Added in 7.20.0)
1375 .IP CURLOPT_RTSP_STREAM_URI
1376 Set the stream URI to operate on by passing a char * . For example, a single
1377 session may be controlling \fIrtsp://foo/twister/audio\fP and
1378 \fIrtsp://foo/twister/video\fP and the application can switch to the
1379 appropriate stream using this option. If unset, libcurl will default to
1380 operating on generic server options by passing '*' in the place of the RTSP
1381 Stream URI. This option is distinct from \fICURLOPT_URL\fP. When working with
1382 RTSP, the \fICURLOPT_STREAM_URI\fP indicates what URL to send to the server in
1383 the request header while the \fICURLOPT_URL\fP indicates where to make the
1384 connection to.  (e.g. the \fICURLOPT_URL\fP for the above examples might be
1385 set to \fIrtsp://foo/twister\fP (Added in 7.20.0)
1386 .IP CURLOPT_RTSP_TRANSPORT
1387 Pass a char * to tell libcurl what to pass for the Transport: header for this
1388 RTSP session. This is mainly a convenience method to avoid needing to set a
1389 custom Transport: header for every SETUP request. The application must set a
1390 Transport: header before issuing a SETUP request. (Added in 7.20.0)
1391 .IP CURLOPT_RTSP_HEADER
1392 This option is simply an alias for \fICURLOPT_HTTP_HEADER\fP. Use this to
1393 replace the standard headers that RTSP and HTTP share. It is also valid to use
1394 the shortcuts such as \fICURLOPT_USERAGENT\fP. (Added in 7.20.0)
1395 .IP CURLOPT_RTSP_CLIENT_CSEQ
1396 Manually set the the CSEQ number to issue for the next RTSP request. Useful if
1397 the application is resuming a previously broken connection. The CSEQ will
1398 increment from this new number henceforth. (Added in 7.20.0)
1399 .IP CURLOPT_RTSP_SERVER_CSEQ
1400 Manually set the CSEQ number to expect for the next RTSP Server->Client
1401 request.  At the moment, this feature (listening for Server requests) is
1402 unimplemented. (Added in 7.20.0)
1403 .SH PROTOCOL OPTIONS
1404 .IP CURLOPT_TRANSFERTEXT
1405 A parameter set to 1 tells the library to use ASCII mode for FTP transfers,
1406 instead of the default binary transfer. For win32 systems it does not set the
1407 stdout to binary mode. This option can be usable when transferring text data
1408 between systems with different views on certain characters, such as newlines
1409 or similar.
1410
1411 libcurl does not do a complete ASCII conversion when doing ASCII transfers
1412 over FTP. This is a known limitation/flaw that nobody has rectified. libcurl
1413 simply sets the mode to ASCII and performs a standard transfer.
1414 .IP CURLOPT_PROXY_TRANSFER_MODE
1415 Pass a long. If the value is set to 1 (one), it tells libcurl to set the
1416 transfer mode (binary or ASCII) for FTP transfers done via an HTTP proxy, by
1417 appending ;type=a or ;type=i to the URL. Without this setting, or it being set
1418 to 0 (zero, the default), \fICURLOPT_TRANSFERTEXT\fP has no effect when doing
1419 FTP via a proxy. Beware that not all proxies support this feature.  (Added in
1420 7.18.0)
1421 .IP CURLOPT_CRLF
1422 Convert Unix newlines to CRLF newlines on transfers.
1423 .IP CURLOPT_RANGE
1424 Pass a char * as parameter, which should contain the specified range you
1425 want. It should be in the format "X-Y", where X or Y may be left out. HTTP
1426 transfers also support several intervals, separated with commas as in
1427 \fI"X-Y,N-M"\fP. Using this kind of multiple intervals will cause the HTTP
1428 server to send the response document in pieces (using standard MIME separation
1429 techniques). For RTSP, the formatting of a range should follow RFC 2326
1430 Section 12.29. For RTSP, byte ranges are \fBnot\fP permitted. Instead, ranges
1431 should be given in npt, utc, or smpte formats.
1432
1433 Pass a NULL to this option to disable the use of ranges.
1434
1435 Ranges work on HTTP, FTP, FILE (since 7.18.0), and RTSP (since 7.20.0)
1436 transfers only.
1437 .IP CURLOPT_RESUME_FROM
1438 Pass a long as parameter. It contains the offset in number of bytes that you
1439 want the transfer to start from. Set this option to 0 to make the transfer
1440 start from the beginning (effectively disabling resume). For FTP, set this
1441 option to -1 to make the transfer start from the end of the target file
1442 (useful to continue an interrupted upload).
1443 .IP CURLOPT_RESUME_FROM_LARGE
1444 Pass a curl_off_t as parameter. It contains the offset in number of bytes that
1445 you want the transfer to start from. (Added in 7.11.0)
1446 .IP CURLOPT_CUSTOMREQUEST
1447 Pass a pointer to a zero terminated string as parameter. It will be used
1448 instead of GET or HEAD when doing an HTTP request, or instead of LIST or NLST
1449 when doing a FTP directory listing. This is useful for doing DELETE or other
1450 more or less obscure HTTP requests. Don't do this at will, make sure your
1451 server supports the command first.
1452
1453 When you change the request method by setting \fBCURLOPT_CUSTOMREQUEST\fP to
1454 something, you don't actually change how libcurl behaves or acts in regards to
1455 the particular request method, it will only change the actual string sent in
1456 the request.
1457
1458 For example: if you tell libcurl to do a HEAD request, but then change the
1459 request to a "GET" with \fBCURLOPT_CUSTOMREQUEST\fP you'll still see libcurl
1460 act as if it sent a HEAD even when it does send a GET.
1461
1462 To switch to a proper HEAD, use \fICURLOPT_NOBODY\fP, to switch to a proper
1463 POST, use \fICURLOPT_POST\fP or \fICURLOPT_POSTFIELDS\fP and so on.
1464
1465 Restore to the internal default by setting this to NULL.
1466
1467 Many people have wrongly used this option to replace the entire request with
1468 their own, including multiple headers and POST contents. While that might work
1469 in many cases, it will cause libcurl to send invalid requests and it could
1470 possibly confuse the remote server badly. Use \fICURLOPT_POST\fP and
1471 \fICURLOPT_POSTFIELDS\fP to set POST data. Use \fICURLOPT_HTTPHEADER\fP to
1472 replace or extend the set of headers sent by libcurl. Use
1473 \fICURLOPT_HTTP_VERSION\fP to change HTTP version.
1474 .IP CURLOPT_FILETIME
1475 Pass a long. If it is 1, libcurl will attempt to get the modification date of
1476 the remote document in this operation. This requires that the remote server
1477 sends the time or replies to a time querying command. The
1478 \fIcurl_easy_getinfo(3)\fP function with the \fICURLINFO_FILETIME\fP argument
1479 can be used after a transfer to extract the received time (if any).
1480 .IP CURLOPT_NOBODY
1481 A parameter set to 1 tells the library to not include the body-part in the
1482 output. This is only relevant for protocols that have separate header and body
1483 parts. On HTTP(S) servers, this will make libcurl do a HEAD request.
1484
1485 To change request to GET, you should use \fICURLOPT_HTTPGET\fP. Change request
1486 to POST with \fICURLOPT_POST\fP etc.
1487 .IP CURLOPT_INFILESIZE
1488 When uploading a file to a remote site, this option should be used to tell
1489 libcurl what the expected size of the infile is. This value should be passed
1490 as a long. See also \fICURLOPT_INFILESIZE_LARGE\fP.
1491
1492 For uploading using SCP, this option or \fICURLOPT_INFILESIZE_LARGE\fP is
1493 mandatory.
1494
1495 This option does not limit how much data libcurl will actually send, as that
1496 is controlled entirely by what the read callback returns.
1497 .IP CURLOPT_INFILESIZE_LARGE
1498 When uploading a file to a remote site, this option should be used to tell
1499 libcurl what the expected size of the infile is.  This value should be passed
1500 as a curl_off_t. (Added in 7.11.0)
1501
1502 For uploading using SCP, this option or \fICURLOPT_INFILESIZE\fP is mandatory.
1503
1504 This option does not limit how much data libcurl will actually send, as that
1505 is controlled entirely by what the read callback returns.
1506 .IP CURLOPT_UPLOAD
1507 A parameter set to 1 tells the library to prepare for an upload. The
1508 \fICURLOPT_READDATA\fP and \fICURLOPT_INFILESIZE\fP or
1509 \fICURLOPT_INFILESIZE_LARGE\fP options are also interesting for uploads. If
1510 the protocol is HTTP, uploading means using the PUT request unless you tell
1511 libcurl otherwise.
1512
1513 Using PUT with HTTP 1.1 implies the use of a "Expect: 100-continue" header.
1514 You can disable this header with \fICURLOPT_HTTPHEADER\fP as usual.
1515
1516 If you use PUT to a HTTP 1.1 server, you can upload data without knowing the
1517 size before starting the transfer if you use chunked encoding. You enable this
1518 by adding a header like "Transfer-Encoding: chunked" with
1519 \fICURLOPT_HTTPHEADER\fP. With HTTP 1.0 or without chunked transfer, you must
1520 specify the size.
1521 .IP CURLOPT_MAXFILESIZE
1522 Pass a long as parameter. This allows you to specify the maximum size (in
1523 bytes) of a file to download. If the file requested is larger than this value,
1524 the transfer will not start and CURLE_FILESIZE_EXCEEDED will be returned.
1525
1526 The file size is not always known prior to download, and for such files this
1527 option has no effect even if the file transfer ends up being larger than this
1528 given limit. This concerns both FTP and HTTP transfers.
1529 .IP CURLOPT_MAXFILESIZE_LARGE
1530 Pass a curl_off_t as parameter. This allows you to specify the maximum size
1531 (in bytes) of a file to download. If the file requested is larger than this
1532 value, the transfer will not start and \fICURLE_FILESIZE_EXCEEDED\fP will be
1533 returned. (Added in 7.11.0)
1534
1535 The file size is not always known prior to download, and for such files this
1536 option has no effect even if the file transfer ends up being larger than this
1537 given limit. This concerns both FTP and HTTP transfers.
1538 .IP CURLOPT_TIMECONDITION
1539 Pass a long as parameter. This defines how the \fICURLOPT_TIMEVALUE\fP time
1540 value is treated. You can set this parameter to \fICURL_TIMECOND_IFMODSINCE\fP
1541 or \fICURL_TIMECOND_IFUNMODSINCE\fP. This feature applies to HTTP, FTP, and
1542 RTSP.
1543
1544 The last modification time of a file is not always known and in such instances
1545 this feature will have no effect even if the given time condition would not
1546 have been met. \fIcurl_easy_getinfo(3)\fP with the
1547 \fICURLINFO_CONDITION_UNMET\fP option can be used after a transfer to learn if
1548 a zero-byte successful "transfer" was due to this condition not matching.
1549 .IP CURLOPT_TIMEVALUE
1550 Pass a long as parameter. This should be the time in seconds since 1 Jan 1970,
1551 and the time will be used in a condition as specified with
1552 \fICURLOPT_TIMECONDITION\fP.
1553 .SH CONNECTION OPTIONS
1554 .IP CURLOPT_TIMEOUT
1555 Pass a long as parameter containing the maximum time in seconds that you allow
1556 the libcurl transfer operation to take. Normally, name lookups can take a
1557 considerable time and limiting operations to less than a few minutes risk
1558 aborting perfectly normal operations. This option will cause curl to use the
1559 SIGALRM to enable time-outing system calls.
1560
1561 In unix-like systems, this might cause signals to be used unless
1562 \fICURLOPT_NOSIGNAL\fP is set.
1563 .IP CURLOPT_TIMEOUT_MS
1564 Like \fICURLOPT_TIMEOUT\fP but takes number of milliseconds instead. If
1565 libcurl is built to use the standard system name resolver, that portion
1566 of the transfer will still use full-second resolution for timeouts with
1567 a minimum timeout allowed of one second.
1568 (Added in 7.16.2)
1569 .IP CURLOPT_LOW_SPEED_LIMIT
1570 Pass a long as parameter. It contains the transfer speed in bytes per second
1571 that the transfer should be below during \fICURLOPT_LOW_SPEED_TIME\fP seconds
1572 for the library to consider it too slow and abort.
1573 .IP CURLOPT_LOW_SPEED_TIME
1574 Pass a long as parameter. It contains the time in seconds that the transfer
1575 should be below the \fICURLOPT_LOW_SPEED_LIMIT\fP for the library to consider
1576 it too slow and abort.
1577 .IP CURLOPT_MAX_SEND_SPEED_LARGE
1578 Pass a curl_off_t as parameter.  If an upload exceeds this speed (counted in
1579 bytes per second) on cumulative average during the transfer, the transfer will
1580 pause to keep the average rate less than or equal to the parameter value.
1581 Defaults to unlimited speed. (Added in 7.15.5)
1582 .IP CURLOPT_MAX_RECV_SPEED_LARGE
1583 Pass a curl_off_t as parameter.  If a download exceeds this speed (counted in
1584 bytes per second) on cumulative average during the transfer, the transfer will
1585 pause to keep the average rate less than or equal to the parameter
1586 value. Defaults to unlimited speed. (Added in 7.15.5)
1587 .IP CURLOPT_MAXCONNECTS
1588 Pass a long. The set number will be the persistent connection cache size. The
1589 set amount will be the maximum amount of simultaneously open connections that
1590 libcurl may cache in this easy handle. Default is 5, and there isn't much
1591 point in changing this value unless you are perfectly aware of how this works
1592 and changes libcurl's behaviour. This concerns connections using any of the
1593 protocols that support persistent connections.
1594
1595 When reaching the maximum limit, curl closes the oldest one in the cache to
1596 prevent increasing the number of open connections.
1597
1598 If you already have performed transfers with this curl handle, setting a
1599 smaller MAXCONNECTS than before may cause open connections to get closed
1600 unnecessarily.
1601
1602 If you add this easy handle to a multi handle, this setting is not
1603 acknowledged, and you must instead use \fIcurl_multi_setopt(3)\fP and the
1604 \fICURLMOPT_MAXCONNECTS\fP option.
1605 .IP CURLOPT_CLOSEPOLICY
1606 (Obsolete) This option does nothing.
1607 .IP CURLOPT_FRESH_CONNECT
1608 Pass a long. Set to 1 to make the next transfer use a new (fresh) connection
1609 by force. If the connection cache is full before this connection, one of the
1610 existing connections will be closed as according to the selected or default
1611 policy. This option should be used with caution and only if you understand
1612 what it does. Set this to 0 to have libcurl attempt re-using an existing
1613 connection (default behavior).
1614 .IP CURLOPT_FORBID_REUSE
1615 Pass a long. Set to 1 to make the next transfer explicitly close the
1616 connection when done. Normally, libcurl keeps all connections alive when done
1617 with one transfer in case a succeeding one follows that can re-use them.
1618 This option should be used with caution and only if you understand what it
1619 does. Set to 0 to have libcurl keep the connection open for possible later
1620 re-use (default behavior).
1621 .IP CURLOPT_CONNECTTIMEOUT
1622 Pass a long. It should contain the maximum time in seconds that you allow the
1623 connection to the server to take.  This only limits the connection phase, once
1624 it has connected, this option is of no more use. Set to zero to disable
1625 connection timeout (it will then only timeout on the system's internal
1626 timeouts). See also the \fICURLOPT_TIMEOUT\fP option.
1627
1628 In unix-like systems, this might cause signals to be used unless
1629 \fICURLOPT_NOSIGNAL\fP is set.
1630 .IP CURLOPT_CONNECTTIMEOUT_MS
1631 Like \fICURLOPT_CONNECTTIMEOUT\fP but takes the number of milliseconds
1632 instead. If libcurl is built to use the standard system name resolver,
1633 that portion of the connect will still use full-second resolution for
1634 timeouts with a minimum timeout allowed of one second.
1635 (Added in 7.16.2)
1636 .IP CURLOPT_IPRESOLVE
1637 Allows an application to select what kind of IP addresses to use when
1638 resolving host names. This is only interesting when using host names that
1639 resolve addresses using more than one version of IP. The allowed values are:
1640 .RS
1641 .IP CURL_IPRESOLVE_WHATEVER
1642 Default, resolves addresses to all IP versions that your system allows.
1643 .IP CURL_IPRESOLVE_V4
1644 Resolve to IPv4 addresses.
1645 .IP CURL_IPRESOLVE_V6
1646 Resolve to IPv6 addresses.
1647 .RE
1648 .IP CURLOPT_CONNECT_ONLY
1649 Pass a long. If the parameter equals 1, it tells the library to perform all
1650 the required proxy authentication and connection setup, but no data transfer.
1651 This option is useful only on HTTP URLs.
1652
1653 This option is useful with the \fICURLINFO_LASTSOCKET\fP option to
1654 \fIcurl_easy_getinfo(3)\fP. The library can set up the connection and then the
1655 application can obtain the most recently used socket for special data
1656 transfers. (Added in 7.15.2)
1657 .SH SSL and SECURITY OPTIONS
1658 .IP CURLOPT_SSLCERT
1659 Pass a pointer to a zero terminated string as parameter. The string should be
1660 the file name of your certificate. The default format is "PEM" and can be
1661 changed with \fICURLOPT_SSLCERTTYPE\fP.
1662
1663 With NSS this is the nickname of the certificate you wish to authenticate
1664 with.
1665 .IP CURLOPT_SSLCERTTYPE
1666 Pass a pointer to a zero terminated string as parameter. The string should be
1667 the format of your certificate. Supported formats are "PEM" and "DER".  (Added
1668 in 7.9.3)
1669 .IP CURLOPT_SSLKEY
1670 Pass a pointer to a zero terminated string as parameter. The string should be
1671 the file name of your private key. The default format is "PEM" and can be
1672 changed with \fICURLOPT_SSLKEYTYPE\fP.
1673 .IP CURLOPT_SSLKEYTYPE
1674 Pass a pointer to a zero terminated string as parameter. The string should be
1675 the format of your private key. Supported formats are "PEM", "DER" and "ENG".
1676
1677 The format "ENG" enables you to load the private key from a crypto engine. In
1678 this case \fICURLOPT_SSLKEY\fP is used as an identifier passed to the
1679 engine. You have to set the crypto engine with \fICURLOPT_SSLENGINE\fP.
1680 \&"DER" format key file currently does not work because of a bug in OpenSSL.
1681 .IP CURLOPT_KEYPASSWD
1682 Pass a pointer to a zero terminated string as parameter. It will be used as
1683 the password required to use the \fICURLOPT_SSLKEY\fP or
1684 \fICURLOPT_SSH_PRIVATE_KEYFILE\fP private key.
1685 You never needed a pass phrase to load a certificate but you need one to
1686 load your private key.
1687
1688 (This option was known as CURLOPT_SSLKEYPASSWD up to 7.16.4 and
1689 CURLOPT_SSLCERTPASSWD up to 7.9.2)
1690 .IP CURLOPT_SSLENGINE
1691 Pass a pointer to a zero terminated string as parameter. It will be used as
1692 the identifier for the crypto engine you want to use for your private
1693 key.
1694
1695 If the crypto device cannot be loaded, \fICURLE_SSL_ENGINE_NOTFOUND\fP is
1696 returned.
1697 .IP CURLOPT_SSLENGINE_DEFAULT
1698 Sets the actual crypto engine as the default for (asymmetric) crypto
1699 operations.
1700
1701 If the crypto device cannot be set, \fICURLE_SSL_ENGINE_SETFAILED\fP is
1702 returned.
1703
1704 Even though this option doesn't need any parameter, in some configurations
1705 \fIcurl_easy_setopt\fP might be defined as a macro taking exactly three
1706 arguments. Therefore, it's recommended to pass 1 as parameter to this option.
1707 .IP CURLOPT_SSLVERSION
1708 Pass a long as parameter to control what version of SSL/TLS to attempt to use.
1709 The available options are:
1710 .RS
1711 .IP CURL_SSLVERSION_DEFAULT
1712 The default action. This will attempt to figure out the remote SSL protocol
1713 version, i.e. either SSLv3 or TLSv1 (but not SSLv2, which became disabled
1714 by default with 7.18.1).
1715 .IP CURL_SSLVERSION_TLSv1
1716 Force TLSv1
1717 .IP CURL_SSLVERSION_SSLv2
1718 Force SSLv2
1719 .IP CURL_SSLVERSION_SSLv3
1720 Force SSLv3
1721 .RE
1722 .IP CURLOPT_SSL_VERIFYPEER
1723 Pass a long as parameter.
1724
1725 This option determines whether curl verifies the authenticity of the peer's
1726 certificate. A value of 1 means curl verifies; zero means it doesn't.  The
1727 default is nonzero, but before 7.10, it was zero.
1728
1729 When negotiating an SSL connection, the server sends a certificate indicating
1730 its identity.  Curl verifies whether the certificate is authentic, i.e. that
1731 you can trust that the server is who the certificate says it is.  This trust
1732 is based on a chain of digital signatures, rooted in certification authority
1733 (CA) certificates you supply.  As of 7.10, curl installs a default bundle of
1734 CA certificates and you can specify alternate certificates with the
1735 \fICURLOPT_CAINFO\fP option or the \fICURLOPT_CAPATH\fP option.
1736
1737 When \fICURLOPT_SSL_VERIFYPEER\fP is nonzero, and the verification fails to
1738 prove that the certificate is authentic, the connection fails.  When the
1739 option is zero, the connection succeeds regardless.
1740
1741 Authenticating the certificate is not by itself very useful.  You typically
1742 want to ensure that the server, as authentically identified by its
1743 certificate, is the server you mean to be talking to.  Use
1744 \fICURLOPT_SSL_VERIFYHOST\fP to control that.
1745 .IP CURLOPT_CAINFO
1746 Pass a char * to a zero terminated string naming a file holding one or more
1747 certificates to verify the peer with.  This makes sense only when used in
1748 combination with the \fICURLOPT_SSL_VERIFYPEER\fP option.  If
1749 \fICURLOPT_SSL_VERIFYPEER\fP is zero, \fICURLOPT_CAINFO\fP need not
1750 even indicate an accessible file.
1751
1752 This option is by default set to the system path where libcurl's cacert bundle
1753 is assumed to be stored, as established at build time.
1754
1755 When built against NSS, this is the directory that the NSS certificate
1756 database resides in.
1757 .IP CURLOPT_ISSUERCERT
1758 Pass a char * to a zero terminated string naming a file holding a CA
1759 certificate in PEM format. If the option is set, an additional check against
1760 the peer certificate is performed to verify the issuer is indeed the one
1761 associated with the certificate provided by the option. This additional check
1762 is useful in multi-level PKI where one needs to enforce that the peer
1763 certificate is from a specific branch of the tree.
1764
1765 This option makes sense only when used in combination with the
1766 \fICURLOPT_SSL_VERIFYPEER\fP option. Otherwise, the result of the check is not
1767 considered as failure.
1768
1769 A specific error code (CURLE_SSL_ISSUER_ERROR) is defined with the option,
1770 which is returned if the setup of the SSL/TLS session has failed due to a
1771 mismatch with the issuer of peer certificate (\fICURLOPT_SSL_VERIFYPEER\fP has
1772 to be set too for the check to fail). (Added in 7.19.0)
1773 .IP CURLOPT_CAPATH
1774 Pass a char * to a zero terminated string naming a directory holding multiple
1775 CA certificates to verify the peer with. The certificate directory must be
1776 prepared using the openssl c_rehash utility. This makes sense only when used
1777 in combination with the \fICURLOPT_SSL_VERIFYPEER\fP option.  If
1778 \fICURLOPT_SSL_VERIFYPEER\fP is zero, \fICURLOPT_CAPATH\fP need not even
1779 indicate an accessible path.  The \fICURLOPT_CAPATH\fP function apparently
1780 does not work in Windows due to some limitation in openssl. This option is
1781 OpenSSL-specific and does nothing if libcurl is built to use GnuTLS.
1782 .IP CURLOPT_CRLFILE
1783 Pass a char * to a zero terminated string naming a file with the concatenation
1784 of CRL (in PEM format) to use in the certificate validation that occurs during
1785 the SSL exchange.
1786
1787 When curl is built to use NSS or GnuTLS, there is no way to influence the use
1788 of CRL passed to help in the verification process. When libcurl is built with
1789 OpenSSL support, X509_V_FLAG_CRL_CHECK and X509_V_FLAG_CRL_CHECK_ALL are both
1790 set, requiring CRL check against all the elements of the certificate chain if
1791 a CRL file is passed.
1792
1793 This option makes sense only when used in combination with the
1794 \fICURLOPT_SSL_VERIFYPEER\fP option.
1795
1796 A specific error code (CURLE_SSL_CRL_BADFILE) is defined with the option. It
1797 is returned when the SSL exchange fails because the CRL file cannot be loaded.
1798 A failure in certificate verification due to a revocation information found in
1799 the CRL does not trigger this specific error. (Added in 7.19.0)
1800 .IP CURLOPT_CERTINFO
1801 Pass a long set to 1 to enable libcurl's certificate chain info gatherer. With
1802 this enabled, libcurl (if built with OpenSSL) will extract lots of information
1803 and data about the certificates in the certificate chain used in the SSL
1804 connection. This data is then possible to extract after a transfer using
1805 \fIcurl_easy_getinfo(3)\fP and its option \fICURLINFO_CERTINFO\fP. (Added in
1806 7.19.1)
1807 .IP CURLOPT_RANDOM_FILE
1808 Pass a char * to a zero terminated file name. The file will be used to read
1809 from to seed the random engine for SSL. The more random the specified file is,
1810 the more secure the SSL connection will become.
1811 .IP CURLOPT_EGDSOCKET
1812 Pass a char * to the zero terminated path name to the Entropy Gathering Daemon
1813 socket. It will be used to seed the random engine for SSL.
1814 .IP CURLOPT_SSL_VERIFYHOST
1815 Pass a long as parameter.
1816
1817 This option determines whether libcurl verifies that the server cert is for
1818 the server it is known as.
1819
1820 When negotiating a SSL connection, the server sends a certificate indicating
1821 its identity.
1822
1823 When \fICURLOPT_SSL_VERIFYHOST\fP is 2, that certificate must indicate that
1824 the server is the server to which you meant to connect, or the connection
1825 fails.
1826
1827 Curl considers the server the intended one when the Common Name field or a
1828 Subject Alternate Name field in the certificate matches the host name in the
1829 URL to which you told Curl to connect.
1830
1831 When the value is 1, the certificate must contain a Common Name field, but it
1832 doesn't matter what name it says.  (This is not ordinarily a useful setting).
1833
1834 When the value is 0, the connection succeeds regardless of the names in the
1835 certificate.
1836
1837 The default, since 7.10, is 2.
1838
1839 This option controls checking the server's claimed identity.  The server could
1840 be lying.  To control lying, see \fICURLOPT_SSL_VERIFYPEER\fP.
1841 .IP CURLOPT_SSL_CIPHER_LIST
1842 Pass a char *, pointing to a zero terminated string holding the list of
1843 ciphers to use for the SSL connection. The list must be syntactically correct,
1844 it consists of one or more cipher strings separated by colons. Commas or
1845 spaces are also acceptable separators but colons are normally used, \&!, \&-
1846 and \&+ can be used as operators.
1847
1848 For OpenSSL and GnuTLS valid examples of cipher lists include 'RC4-SHA',
1849 \'SHA1+DES\', 'TLSv1' and 'DEFAULT'. The default list is normally set when you
1850 compile OpenSSL.
1851
1852 You'll find more details about cipher lists on this URL:
1853 \fIhttp://www.openssl.org/docs/apps/ciphers.html\fP
1854
1855 For NSS, valid examples of cipher lists include 'rsa_rc4_128_md5',
1856 \'rsa_aes_128_sha\', etc. With NSS you don't add/remove ciphers. If one uses
1857 this option then all known ciphers are disabled and only those passed in
1858 are enabled.
1859
1860 You'll find more details about the NSS cipher lists on this URL:
1861 \fIhttp://directory.fedora.redhat.com/docs/mod_nss.html#Directives\fP
1862
1863 .IP CURLOPT_SSL_SESSIONID_CACHE
1864 Pass a long set to 0 to disable libcurl's use of SSL session-ID caching. Set
1865 this to 1 to enable it. By default all transfers are done using the
1866 cache. While nothing ever should get hurt by attempting to reuse SSL
1867 session-IDs, there seem to be broken SSL implementations in the wild that may
1868 require you to disable this in order for you to succeed. (Added in 7.16.0)
1869 .IP CURLOPT_KRBLEVEL
1870 Pass a char * as parameter. Set the kerberos security level for FTP; this also
1871 enables kerberos awareness.  This is a string, \&'clear', \&'safe',
1872 \&'confidential' or \&'private'.  If the string is set but doesn't match one
1873 of these, 'private' will be used. Set the string to NULL to disable kerberos
1874 support for FTP.
1875
1876 (This option was known as CURLOPT_KRB4LEVEL up to 7.16.3)
1877 .SH SSH OPTIONS
1878 .IP CURLOPT_SSH_AUTH_TYPES
1879 Pass a long set to a bitmask consisting of one or more of
1880 CURLSSH_AUTH_PUBLICKEY, CURLSSH_AUTH_PASSWORD, CURLSSH_AUTH_HOST,
1881 CURLSSH_AUTH_KEYBOARD. Set CURLSSH_AUTH_ANY to let libcurl pick one.
1882 (Added in 7.16.1)
1883 .IP CURLOPT_SSH_HOST_PUBLIC_KEY_MD5
1884 Pass a char * pointing to a string containing 32 hexadecimal digits. The
1885 string should be the 128 bit MD5 checksum of the remote host's public key, and
1886 libcurl will reject the connection to the host unless the md5sums match. This
1887 option is only for SCP and SFTP transfers. (Added in 7.17.1)
1888 .IP CURLOPT_SSH_PUBLIC_KEYFILE
1889 Pass a char * pointing to a file name for your public key. If not used,
1890 libcurl defaults to using \fB~/.ssh/id_dsa.pub\fP.
1891 (Added in 7.16.1)
1892 .IP CURLOPT_SSH_PRIVATE_KEYFILE
1893 Pass a char * pointing to a file name for your private key. If not used,
1894 libcurl defaults to using \fB~/.ssh/id_dsa\fP.  If the file is
1895 password-protected, set the password with \fICURLOPT_KEYPASSWD\fP. (Added in
1896 7.16.1)
1897 .IP CURLOPT_SSH_KNOWNHOSTS
1898 Pass a pointer to a zero terminated string holding the file name of the
1899 known_host file to use.  The known_hosts file should use the OpenSSH file
1900 format as supported by libssh2. If this file is specified, libcurl will only
1901 accept connections with hosts that are known and present in that file, with a
1902 matching public key. Use \fICURLOPT_SSH_KEYFUNCTION\fP to alter the default
1903 behavior on host and key (mis)matching. (Added in 7.19.6)
1904 .IP CURLOPT_SSH_KEYFUNCTION
1905 Pass a pointer to a curl_sshkeycallback function. It gets called when the
1906 known_host matching has been done, to allow the application to act and decide
1907 for libcurl how to proceed. It gets passed the CURL handle, the key from the
1908 known_hosts file, the key from the remote site, info from libcurl on the
1909 matching status and a custom pointer (set with \fICURLOPT_SSH_KEYDATA\fP). It
1910 MUST return one of the following return codes to tell libcurl how to act:
1911 .RS
1912 .IP CURLKHSTAT_FINE_ADD_TO_FILE
1913 The host+key is accepted and libcurl will append it to the known_hosts file
1914 before continuing with the connection. This will also add the host+key combo
1915 to the known_host pool kept in memory if it wasn't already present there. The
1916 adding of data to the file is done by completely replacing the file with a new
1917 copy, so the permissions of the file must allow this.
1918 .IP CURLKHSTAT_FINE
1919 The host+key is accepted libcurl will continue with the connection. This will
1920 also add the host+key combo to the known_host pool kept in memory if it wasn't
1921 already present there.
1922 .IP CURLKHSTAT_REJECT
1923 The host+key is rejected. libcurl will deny the connection to continue and it
1924 will be closed.
1925 .IP CURLKHSTAT_DEFER
1926 The host+key is rejected, but the SSH connection is asked to be kept alive.
1927 This feature could be used when the app wants to somehow return back and act
1928 on the host+key situation and then retry without needing the overhead of
1929 setting it up from scratch again.
1930 .RE
1931  (Added in 7.19.6)
1932 .IP CURLOPT_SSH_KEYDATA
1933 Pass a void * as parameter. This pointer will be passed along verbatim to the
1934 callback set with \fICURLOPT_SSH_KEYFUNCTION\fP. (Added in 7.19.6)
1935 .SH OTHER OPTIONS
1936 .IP CURLOPT_PRIVATE
1937 Pass a void * as parameter, pointing to data that should be associated with
1938 this curl handle.  The pointer can subsequently be retrieved using
1939 \fIcurl_easy_getinfo(3)\fP with the CURLINFO_PRIVATE option. libcurl itself
1940 does nothing with this data. (Added in 7.10.3)
1941 .IP CURLOPT_SHARE
1942 Pass a share handle as a parameter. The share handle must have been created by
1943 a previous call to \fIcurl_share_init(3)\fP. Setting this option, will make
1944 this curl handle use the data from the shared handle instead of keeping the
1945 data to itself. This enables several curl handles to share data. If the curl
1946 handles are used simultaneously in multiple threads, you \fBMUST\fP use the
1947 locking methods in the share handle. See \fIcurl_share_setopt(3)\fP for
1948 details.
1949
1950 If you add a share that is set to share cookies, your easy handle will use
1951 that cookie cache and get the cookie engine enabled. If you unshare an object
1952 that was using cookies (or change to another object that doesn't share
1953 cookies), the easy handle will get its cookie engine disabled.
1954
1955 Data that the share object is not set to share will be dealt with the usual
1956 way, as if no share was used.
1957 .IP CURLOPT_NEW_FILE_PERMS
1958 Pass a long as a parameter, containing the value of the permissions that will
1959 be assigned to newly created files on the remote server.  The default value is
1960 \fI0644\fP, but any valid value can be used.  The only protocols that can use
1961 this are \fIsftp://\fP, \fIscp://\fP, and \fIfile://\fP. (Added in 7.16.4)
1962 .IP CURLOPT_NEW_DIRECTORY_PERMS
1963 Pass a long as a parameter, containing the value of the permissions that will
1964 be assigned to newly created directories on the remote server.  The default
1965 value is \fI0755\fP, but any valid value can be used.  The only protocols that
1966 can use this are \fIsftp://\fP, \fIscp://\fP, and \fIfile://\fP.
1967 (Added in 7.16.4)
1968 .SH TELNET OPTIONS
1969 .IP CURLOPT_TELNETOPTIONS
1970 Provide a pointer to a curl_slist with variables to pass to the telnet
1971 negotiations. The variables should be in the format <option=value>. libcurl
1972 supports the options 'TTYPE', 'XDISPLOC' and 'NEW_ENV'. See the TELNET
1973 standard for details.
1974 .SH RETURN VALUE
1975 CURLE_OK (zero) means that the option was set properly, non-zero means an
1976 error occurred as \fI<curl/curl.h>\fP defines. See the \fIlibcurl-errors(3)\fP
1977 man page for the full list with descriptions.
1978
1979 If you try to set an option that libcurl doesn't know about, perhaps because
1980 the library is too old to support it or the option was removed in a recent
1981 version, this function will return \fICURLE_FAILED_INIT\fP.
1982 .SH "SEE ALSO"
1983 .BR curl_easy_init "(3), " curl_easy_cleanup "(3), " curl_easy_reset "(3)"