]> git.sven.stormbind.net Git - sven/tclcurl.git/blob - doc/SinComprimir/tclcurl.n
Imported Upstream version 7.19.6
[sven/tclcurl.git] / doc / SinComprimir / tclcurl.n
1 .\" You can view this file with:
2 .\" nroff -man [file]
3 .\" Adapted from libcurl docs by fandom@telefonica.net
4 .TH TclCurl n "8 September 2008" "TclCurl 7.19.0 "TclCurl Easy Interface"
5 .SH NAME
6 TclCurl: - get  a  URL with FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, FILE or LDAP syntax.
7 .SH SYNOPSIS
8 .BI "curl::init"
9 .sp
10 .IB curlHandle " configure " "?options?"
11 .sp
12 .IB curlHandle " perform"
13 .sp
14 .IB curlHandle " getinfo " curlinfo_option
15 .sp
16 .IB curlhandle " cleanup"
17 .sp
18 .IB curlhandle " reset"
19 .sp
20 .IB curlHandle " duhandle"
21 .sp
22 .IB curlHandle " pause"
23 .sp
24 .IB curlHandle " resume"
25 .sp
26 .BI curl::transfer " ?options?"
27 .sp
28 .BI curl::version
29 .sp
30 .BI "curl::escape " url
31 .sp
32 .BI "curl::unescape " url
33 .sp
34 .BI "curl::curlConfig " option
35 .sp
36 .BI "curl::versioninfo " option
37 .sp
38 .BI "curl::easystrerror " errorCode
39
40 .SH DESCRIPTION
41 The TclCurl extension gives Tcl programmers access to the libcurl
42 library written by \fBDaniel Stenberg\fP, with it you can download urls,
43 upload them and many other neat tricks, for more information check
44 .I http://curl.haxx.se
45 .SH curl::init
46 This procedure must be the first one to call, it returns a
47 .I curlHandle
48 that you need to use to invoke TclCurl procedures. The init calls intializes
49 curl and this call MUST have a corresponding call to
50 .I cleanup
51 when the operation is completed.
52 You should perform all your sequential file transfers using the same
53 curlHandle. This enables TclCurl to use persistant connections when
54 possible.
55 .sp
56 .B RETURN VALUE
57 .sp
58 .I curlHandle
59 to use.
60 .SH curlHandle configure ?options?
61 .sp
62 .B configure
63 is called to set the options for the transfer. Most operations in TclCurl
64 have default actions, and by using the appropriate options you can
65 make them behave differently (as documented). All options are set with
66 the \fIoption\fP followed by a parameter.
67 .sp
68 .B Notes:
69 the options set with this procedure are valid for the
70 forthcoming data transfers that are performed when you invoke
71 .I perform
72 .sp
73 The options are not reset between transfers (except where noted), so if
74 you want subsequent transfers with different options, you must change them
75 between the transfers. You can optionally reset all options back to the internal
76 default with \fBcurlHandle reset\fP.
77 .sp
78 .I "curlHandle"
79 is the return code from the
80 .I "curl::init"
81 call.
82 .sp
83
84 .B OPTIONS
85 .sp
86 .SH Behaviour options
87
88 .TP
89 .B -verbose
90 Set the parameter to 1 to get the library to display a lot of verbose
91 information about its operations. Very useful for libcurl and/or protocol
92 debugging and understanding.
93
94 You hardly ever want this set in production use, you will almost always want
95 this when you debug/report problems. Another neat option for debugging is
96 .B -debugproc
97
98 .TP
99 .B -header
100 A 1 tells the extension to include the headers in the body output. This is
101 only relevant for protocols that actually have headers preceding the data (like HTTP).
102
103 .TP
104 .B -noprogress
105 A 1 tells the extension to turn on the built-in progress meter.
106 Nowadays it is turn off by default.
107
108 .TP
109 .B -nosignal
110 A 1 tells TclCurl not use any functions that install signal
111 handlers or any functions that cause signals to be sent to the process. This
112 option is mainly here to allow multi-threaded unix applications to still
113 set/use all timeout options etc, without risking getting signals.
114
115
116 .SH Callback options
117
118 .TP
119 .B -writeproc
120 Use it to set a Tcl procedure that will be invoked by TclCurl as soon as
121 there is received data that needs to be saved. The procedure will receive
122 a single parameter with the data to be saved.
123
124 NOTE: you will be passed as much data as possible in all invokes, but you
125 cannot possibly make any assumptions. It may be nothing if the file is
126 empty or it may be thousands of bytes.
127
128 .TP
129 .B -file
130 File in which the transfered data will be saved.
131
132 .TP
133 .B -readproc
134 Sets a Tcl procedure to be called by TclCurl as soon as it needs to read
135 data in order to send it to the peer. The procedure has to take one
136 parameter, which will contain the maximun numbers of bytes to read. It
137 should return the actual number of bytes read, or '0' if you want to
138 stop the transfer.
139
140 .TP
141 .B -infile
142 File from which the data will be transfered.
143
144 .TP
145 .B -progressproc
146 Name of the Tcl procedure that will invoked by TclCurl  with a frequent
147 interval during operation (roughly once per second), no matter if data
148 is being transfered or not.  Unknown/unused
149 argument values passed to the callback will be set to zero (like if you
150 only download data, the upload size will remain 0), the prototype of the
151 procedure must be:
152 .sp
153 .B proc ProgressCallback {dltotal dlnow ultotal ulnow}
154 .sp
155 In order to this option to work you have to set the \fBnoprogress\fP
156 option to '0'. Setting this option to the empty string will restore the
157 original progress function.
158
159 If you transfer data with the multi interface, this procedure will not be
160 called during periods of idleness unless you call the appropriate procedure
161 that performs transfers.
162
163 You can pause and resume a transfer from within this procedure using the
164 \fBpause\fP and \fBresume\fP commands.
165
166 .TP
167 .B -writeheader
168 Pass a the file name to be used to write the header part of the received data to.
169 The headers are guaranteed to be written one-by-one to this file and
170 only complete lines are written. Parsing headers should be easy enough using
171 this.
172
173 .TP
174 .B -debugproc
175 Name of the procedure that will receive the debug data produced by the
176 .B -verbose
177 option, it should match the following prototype:
178 .sp
179 .B debugProc {infoType data}
180 .sp
181 where \fBinfoType\fP specifies what kind of information it is (0 text,
182 1 incoming header, 2 outgoing header, 3 incoming data, 4 outgoing data,
183 5 incoming SSL data, 6 outgoing SSL data).
184
185 .SH Error Options
186
187 .TP
188 .B -errorbuffer
189 Pass a variable name where TclCurl may store human readable error
190 messages in. This may be more helpful than just the return code from the
191 command.
192
193 .TP
194 .B -stderr
195 Pass a file name as parameter. This is the stream to use internally instead
196 of stderr when reporting errors.
197 .TP
198 .B -failonerror
199 A 1 parameter tells the extension to fail silently if the HTTP code
200 returned is equal or larger than 400. The default action would be to return
201 the page normally, ignoring that code.
202
203 This method is not fail-safe and there are occasions where non-successful response
204 codes will slip through, especially when authentication is involved
205 (response codes 401 and 407). 
206
207 You might get some amounts of headers transferred before this situation is detected,
208 like for when a "100-continue" is received as a response to a POST/PUT and a 401
209 or 407 is received immediately afterwards.
210
211 .SH Network options
212
213 .TP
214 .B -url
215 The actual URL to deal with.
216
217 If the given URL lacks the protocol part ("http://" or "ftp://" etc), it will
218 attempt to guess which protocol to use based on the given host name. If the
219 given protocol of the set URL is not supported, TclCurl will return the
220 \fBunsupported protocol\fP error when you call \fBperform\fP. Use
221 \fBcurl::versioninfo\fP for detailed info on which protocols that are supported.
222
223 \fBNOTE\fP: this the one option required to be set
224 before
225 .B perform
226 is called.
227
228 .TP
229 .B -proxy
230 If you need to use a http proxy to access the outside world, set the
231 proxy string with this option. To specify port number in this string,
232 append :[port] to the end of the host name. The proxy string may be
233 prefixed with [protocol]:// since any such prefix will be ignored.
234
235 When you tell the extension to use a HTTP proxy, TclCurl will
236 transparently convert operations to HTTP even if you specify a FTP
237 URL etc. This may have an impact on what other features of the library
238 you can use, such as
239 .B quote
240 and similar FTP specifics that will not work unless you tunnel through
241 the HTTP proxy. Such tunneling  is activated with
242 .B proxytunnel
243
244 TclCurl respects the environment variables http_proxy, ftp_proxy,
245 all_proxy etc, if any of those are set. The use of this option does
246 however override any possibly set environment variables.
247
248 Setting the proxy string to "" (an empty string) will explicitly disable
249 the use of a proxy, even if there is an environment variable set for it.
250
251 The proxy host string can be specified the exact same way as the proxy
252 environment variables, include protocol prefix (http://) and embedded
253 user + password.
254
255 .TP
256 .B -proxyport
257 Use this option to set the proxy port to use unless it is specified in
258 the proxy string by \fB-proxy\fP.
259
260 .TP
261 .B -proxytype
262 Pass the type of  the  proxy. Available options are 'http', 'socks4', 'socks4a'
263 and 'socks5', with the HTTP one being default.
264
265 .TP
266 .B -httpproxytunnel
267 Set the parameter to 1 to get the extension to tunnel all non-HTTP
268 operations through the given HTTP proxy. Do note that there is a big
269 difference between using a proxy and tunneling through it. If you don't know what
270 this means, you probably don't want this tunnel option.
271
272 .TP
273 .B -interface
274 Pass the interface name to use as outgoing
275 network interface. The name can be an interface name, an IP address or a host
276 name.
277
278 .TP
279 .B -localport
280 This sets the local port number of the socket used for connection. This can
281 be used in combination with \fB-interface\fP and you are recommended to use
282 \fBlocalportrange\fP as well when this is set. Note the only valid port numbers
283 are 1 - 65535.
284
285 .TP
286 .B -localportrange
287 This is the number of attempts TclCurl should do to find a working local port
288 number. It starts with the given \fB-localport\fP and adds
289 one to the number for each retry. Setting this value to 1 or below will make
290 TclCurl do only one try for exact port number. Note that port numbers by nature
291 are a scarce resource that will be busy at times so setting this value to something
292 too low might cause unnecessary connection setup failures.
293
294 .TP
295 .B -dnscachetimeout
296 Pass the timeout in seconds. Name resolves will be kept in memory for this number
297 of seconds. Set to '0' to completely disable caching, or '-1' to make the
298 cached entries remain forever. By default, TclCurl caches this info for 60 seconds.
299
300 .TP
301 .B -dnsuseglobalcache
302 If the value passed is 1, it tells TclCurl to use a global DNS cache that
303 will survive between curl handles creations and deletions. This is not thread-safe
304 as it uses a global varible.
305
306 \fBWARNING:\fP this option is considered obsolete. Stop using it. Switch over
307 to using the share interface instead! See \fItclcurl_share\fP.
308
309 .TP
310 .B -buffersize
311 Pass your prefered size for the receive buffer in TclCurl. The main point of this
312 would be that the write callback gets called more often and with smaller chunks.
313 This is just treated as a request, not an order. You cannot be guaranteed to
314 actually get the given size.
315
316 .TP
317 .B -port
318
319 Pass the number specifying what remote port to connect to, instead of the one specified
320 in the URL or the default port for the used protocol.
321
322 .TP
323 .B -tcpnodelay
324
325 Pass a number to specify whether the TCP_NODELAY option should be set or cleared (1 = set, 0 = clear).
326 The option is cleared by default. This will have no effect after the connection has been established.
327
328 Setting this option will disable TCP's Nagle algorithm. The purpose of this algorithm is to try to
329 minimize the number of small packets on the network (where "small packets" means TCP segments less
330 than the Maximum Segment Size (MSS) for the network).
331
332 Maximizing the amount of data sent per TCP segment is good because it amortizes the overhead of the
333 send. However, in some cases (most notably telnet or rlogin) small segments may need to be sent without
334 delay. This is less efficient than sending larger amounts of data at a time, and can contribute to
335 congestion on the network if overdone.
336
337 .TP
338 .B -addressscope
339 Pass a number specifying the scope_id value to use when connecting to IPv6 link-local or site-local
340 addresses.
341
342 .SH Names and Passwords options
343
344 .TP
345 .B -netrc
346 A 1 parameter tells the extension to scan your
347 .B ~/.netrc
348 file to find user name and password for the remote site you are about to
349 access. Do note that TclCurl does not verify that the file has the correct
350 properties set (as the standard unix ftp client does), and that only machine
351 name, user name and password is taken into account (init macros and similar
352 things are not supported).
353
354 You can set it to the following values:
355 .RS
356 .TP 5
357 .B optional
358 The use of your ~/.netrc file is optional, and information in the URL is to
359 be preferred. The file will be scanned with the host and user name (to find
360 the password only) or with the host only, to find the first user name and
361 password after that machine, which ever information is not specified in
362 the URL.
363
364 Undefined  values  of  the  option  will  have this effect.
365 .TP
366 .B ignored
367 The extension will ignore the file and use only the information in the URL.
368 This is the default.
369 .TP
370 .B required
371 This value tells the library that use of the file is required, to ignore
372 the information in the URL, and to search the file with the host only.
373 .RE
374
375 .TP
376 .B -netrcfile
377 Pass a string containing the full path name to the file you want to use as .netrc
378 file. For the option to work, you have to set the \fBnetrc\fP option to
379 \fBrequired\fP. If this option is omitted, and \fBnetrc\fP is set, TclCurl
380 will attempt to find the a .netrc file in the current user's home directory.
381
382 .TP
383 .B -userpwd
384 Pass a string as parameter, which should be [username]:[password] to use for
385 the connection. Use \fBhttpauth\fP to decide authentication method.
386
387 When using NTLM, you can set domain by prepending it to the user name and
388 separating the domain and name with a forward (/) or backward slash (\\). Like
389 this: "domain/user:password" or "domain\\user:password". Some HTTP servers (on
390 Windows) support this style even for Basic authentication.
391
392 When using HTTP and \fB-followlocation\fP, TclCurl might perform several
393 requests to possibly different hosts. TclCurl will only send this user and
394 password information to hosts using the initial host name (unless
395 \fB-unrestrictedauth\fP is set), so if TclCurl follows locations to other
396 hosts it will not send the user and password to those. This is enforced to
397 prevent accidental information leakage.
398
399 .TP
400 .B -proxyuserpwd
401 Pass a string as parameter, which should be [username]:[password] to use for
402 the connection to the HTTP proxy.
403
404 .TP
405 .B -httpauth
406 Set to the authentication method you want, the available ones are:
407 .RS
408 .TP 5
409 .B basic
410 HTTP Basic authentication. This is the default choice, and the only
411 method that is in widespread use and supported virtually everywhere.
412 It sends the user name and password over the network in plain text,
413 easily captured by others.
414
415 .TP
416 .B digest
417 HTTP Digest authentication. Digest authentication is a more secure
418 way to do authentication over public networks than the regular
419 old-fashioned Basic method.
420
421 .TP
422 .B gssnegotiate
423 HTTP GSS-Negotiate authentication. The GSS-Negotiate method, also known as
424 plain "Negotiate",was designed by Microsoft and is used in their web
425 applications. It is primarily meant as a support for Kerberos5 authentication
426 but may be also used along with another authentication methods.
427
428 .TP
429 .B ntlm
430 HTTP NTLM authentication. A proprietary protocol invented and used by Microsoft.
431 It uses a challenge-response and hash concept similar to Digest, to prevent the
432 password from being eavesdropped.
433
434 .TP
435 .B any
436 TclCurl will automatically select the one it finds most secure.
437
438 .TP
439 .B anysafe
440 It may use anything but basic, TclCurl will automaticly select the
441 one it finds most secure.
442 .RE
443
444 .TP
445 .B -proxyauth
446 Use it to tell TclCurl which authentication method(s) you want it to use for
447 your proxy authentication. Note that for some methods, this will induce an
448 extra network round-trip. Set the actual name and password with the 
449 \fBproxyuserpwd\fP option.
450
451 The methods are those listed above for the \fBhttpauth\fP option. As of this
452 writing, only Basic and NTLM work.
453
454 .SH HTTP options
455
456 .TP
457 .B -autoreferer
458 Pass an 1 parameter to enable this. When enabled, TclCurl will
459 automatically set the Referer: field in requests where it follows a Location:
460 redirect.
461
462 .TP
463 .B -encoding
464 Sets the contents of the Accept-Encoding: header sent in an HTTP
465 request, and enables decoding of a response when a Content-Encoding:
466 header is received.  Three encodings are supported: \fIidentity\fP,
467 which does nothing, \fIdeflate\fP which requests the server to
468 compress its response using the zlib algorithm, and \fIgzip\fP which
469 requests the gzip algorithm.  Use \fIall\fP to send an
470 Accept-Encoding: header containing all supported encodings.
471
472 This is a request, not an order; the server may or may not do it.  This
473 option must be set or else any unsolicited
474 encoding done by the server is ignored. See the special file
475 lib/README.encoding in libcurl docs for details.
476
477 .TP
478 .B -followlocation
479 An 1 tells the library to follow any
480 .B Location: header
481 that the server sends as part of a HTTP header.
482
483 \fBNOTE\fP: this means that the extension will re-send the  same
484 request on the new location and follow new \fBLocation: headers\fP
485 all the way until no more such headers are returned.
486 \fB-maxredirs\fP can be used to limit the number of redirects
487 TclCurl will follow.
488
489 .TP
490 .B -unrestrictedauth
491 An 1 parameter tells the extension it can continue
492 to  send authentication (user+password) when following
493 locations, even when hostname changed. Note that  this
494 is  meaningful  only  when setting \fB-followlocation\fP.
495
496 .TP
497 .B -maxredirs
498 Sets the redirection limit. If that many redirections have been followed,
499 the next redirect will cause an error. This option only makes sense if the
500 \fB-followlocation\fP option is used at the same time. Setting the limit
501 to 0 will make libcurl refuse any redirect. Set it to -1 for an infinite
502 number of redirects (which is the default)
503
504 .TP
505 .B -post301
506 An 1 tells TclCurl to respect RFC 2616/10.3.2 and not
507 convert POST requests into GET requests when following a 301 redirection. The
508 non-RFC behaviour is ubiquitous in web browsers, so the conversion is done
509 by default to maintain consistency. However, a server may require
510 a POST to remain a POST after such a redirection. This option is meaningful
511 only when setting \fB-followlocation\fP.
512
513 .TP
514 .B -put
515 An 1 parameter tells the extension to use HTTP PUT a file. The file to put
516 must be set with \fB-infile\fP and \fB-infilesize\fP.
517
518 This option is deprecated starting with version 0.12.1, you should use \fB-upload\fP.
519
520 .TP
521 .B -post
522 An 1 parameter tells the library to do a regular HTTP post. This is a
523 normal application/x-www-form-urlencoded kind, which is the most commonly used
524 one by HTML forms. See the \fB-postfields\fP option for how to specify the
525 data to post and \fB-postfieldsize\fP about how to set the data size.
526
527 Use the \fB-postfields\fP option to specify what data to post and \fB-postfieldsize\fP
528 to set the data size. Optionally, you can provide data to POST using the \fB-readproc\fP
529 options.
530
531 You can override the default POST Content-Type: header by setting your own with
532 \fB-httpheader\fP.
533
534 Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header.
535 You can disable this header with \fB-httpheader\fP as usual.
536
537 If you use POST to a HTTP 1.1 server, you can send data without knowing the
538 size before starting the POST if you use chunked encoding. You enable this
539 by adding a header like "Transfer-Encoding: chunked" with \fB-httpheader\fP.
540 With HTTP 1.0 or without chunked transfer, you must specify the size in the
541 request.
542
543 When setting \fBpost\fP to an 1 value, it will automatically set
544 \fBnobody\fP to 0.
545
546 NOTE: if you have issued a POST request and want to make a HEAD or GET instead, you must
547 explicitly pick the new request type using \fB-nobody\fP or \fB-httpget\fP or similar.
548
549 .TP
550 .B -postfields
551 Pass a string as parameter, which should be the full data to post in a HTTP
552 POST operation. You must make sure that the data is formatted the way you
553 want the server to receive it. TclCurl will not convert or encode it for you.
554 Most web servers will assume this data to be url-encoded.
555
556 This is a normal application/x-www-form-urlencoded  kind,
557 which is the most commonly used one by HTML forms.
558
559 If you want to do a zero-byte POST, you need to set
560 \fB-postfieldsize\fP explicitly to zero, as simply setting
561 \fB-postfields\fP to NULL or "" just effectively disables the sending
562 of the specified string. TclCurl will instead assume that the POST
563 data will be send using the read callback!
564
565 Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header.
566 You can disable this header with \fB-httpheader\fP as usual.
567
568 \fBNote\fP: to make multipart/formdata posts (aka rfc1867-posts), check out
569 \fB-httppost\fP option.
570
571 .TP
572 .B -postfieldsize
573 If you want to post data to the server without letting TclCurl do a strlen()
574 to measure the data size, this option must be used. Also, when this option is
575 used, you can post fully binary data which otherwise is likely to fail. If
576 this size is set to zero, the library will use strlen() to get the data
577 size.
578
579 .TP
580 .B -httppost
581 Tells TclCurl you want a multipart/formdata HTTP POST to be made and you
582 instruct what data to pass on to the server through a
583 .B Tcl list.
584
585 \fBThis is the only case where the data is reset after a transfer.\fP
586
587 First, there are some basics you need to understand about multipart/formdata
588 posts. Each part consists of at least a \fBNAME\fP and a \fBCONTENTS\fP part. If the part
589 is made for file upload, there are also a stored \fBCONTENT-TYPE\fP and a
590 \fBFILENAME\fP. Below, we'll discuss on what options you use to set these
591 properties in the parts you want to add to your post.
592
593 The list must contain a \fB'name'\fP tag with the name of the section followed
594 by a string with the name, there are three tags to indicate the value of
595 the section: \fB'value'\fP followed by a string with the data to post, \fB'file'\fP
596 followed by the name of the file to post and \fB'contenttype'\fP with the
597 type of the data (text/plain, image/jpg, ...), you can also indicate a \fIfalse\fP
598 file name with \fB'filename'\fP, this is useful in case the server checks if the given
599 file name is valid, for example, by testing if it starts with 'c:\\' as any real file
600 name does or if you want to include the full path of the file to post. You can also post
601 the content of a variable as if it were a file with the options \fB'bufferName'\fP and
602 \fB'buffer'\fP or use \fB'filecontent'\fP followed by a file name to read that file and
603 use the contents as data.
604
605 Should you need to specify extra headers for the form POST section, use
606 \fB'contentheader\fP' followed by a list with the headers to post.
607
608 Please see 'httpPost.tcl' and 'httpBufferPost.tcl' for examples.
609
610 If TclCurl can't set the data to post an error will be returned:
611 .RS
612 .TP 5
613 .B 1
614 If the memory allocation fails.
615 .TP
616 .B 2
617 If one option is given twice for one form.
618 .TP
619 .B 3
620 If an empty string was given.
621 .TP
622 .B 4
623 If an unknown option was used.
624 .TP
625 .B 5
626 If the some form info is not complete (or error)
627 .TP
628 .B 6
629 If an illegal option is used in an array.
630 .TP
631 .B 7
632 TclCurl has no http support.
633 .RE
634
635 .TP
636 .B -referer
637 Pass a string as parameter. It will be used to set the
638 .B referer
639 header in the http request sent to the remote server. This can be used to
640 fool servers or scripts. You can also set any custom header with
641 .B -httpheader.
642
643 .TP
644 .B -useragent
645 Pass a string as parameter. It will be used to set the
646 .B user-agent:
647 header in the http request sent to the remote server. This can be used to fool
648 servers or scripts. You can also set any custom header with
649 .B -httpheader.
650
651 .TP
652 .B -httpheader
653 Pass a
654 .B list
655 with the HTTP headers to pass to the server in your request.
656 If you add a header that is otherwise generated
657 and used by TclCurl internally, your added one will be used instead. If you
658 add a header with no contents as in 'Accept:', the internally used header will
659 just get disabled. Thus, using this option you can add new headers, replace
660 and remove internal headers.
661
662 The headers included in the linked list must not be CRLF-terminated, because
663 TclCurl adds CRLF after each header item. Failure to comply with this will
664 result in strange bugs because the server will most likely ignore part of the
665 headers you specified.
666
667 The first line in a request (containing the method, usually a GET or POST) is
668 not a header and cannot be replaced using this option. Only the lines
669 following the request-line are headers. Adding this method line in this list
670 of headers will only cause your request to send an invalid header.
671
672 \fBNOTE\fP:The most commonly replaced headers have "shortcuts" in the  options:
673 .B cookie, useragent,
674 and
675 .B referer.
676
677 .TP
678 .B -http200aliases
679 Pass a list of aliases to be treated as valid HTTP 200 responses. Some servers
680 respond with a custom header response line. For example, IceCast servers respond
681 with "ICY 200 OK". By including this string in your list of aliases, the
682 response will be treated as a valid HTTP header line such as "HTTP/1.0 200 OK".
683
684 \fBNOTE\fP:The alias itself is not parsed for any version strings. Before version
685 7.16.3, TclCurl used the value set by option \fBhttpversion\fP, but starting with
686 7.16.3 the protocol is assumed to match HTTP 1.0 when an alias matched.
687
688 .TP
689 .B -cookie
690 Pass a string as parameter. It will be used to
691 set a cookie in the http request. The format of the string should be
692 '[NAME]=[CONTENTS];'. Where NAME is the cookie name and  CONTENTS is
693 what the cookie should contain.
694
695 If  you  need  to  set mulitple cookies, you need to set them all using
696 a single option and thus you need to concatenate them all in one single string.
697 Set multiple cookies in one string like this: "name1=content1; name2=content2;"
698 etc.
699
700 Note that this option sets the cookie header explictly in the outgoing request(s).
701 If multiple requests are done due to authentication, followed redirections or similar,
702 they will all get this cookie passed on.
703
704 Using this option multiple times will only make the latest string override
705 the previous ones.
706
707 .TP
708 .B -cookiefile
709 Pass a string as parameter. It should contain the name of your file holding
710 cookie data. The cookie data may be in netscape cookie data format or just
711 regular HTTP-style headers dumped to a file.
712
713 Given an empty or non-existing file, this option will enable cookies for this
714 curl handle, making it understand and parse received cookies and then use
715 matching cookies in future requests.
716
717 If you use this option multiple times, you add more files to read.
718
719 .TP
720 .B -cookiejar
721 Pass a file name in which TclCurl will dump all internally known cookies
722 when
723 .B curlHandle cleanup
724 is called. If no cookies are known, no file will be created.
725 Specify "-" to have the cookies written to stdout.
726
727 Using this option also enables cookies for this session, so if you, for
728 example, follow a location it will make matching cookies get sent accordingly.
729
730 TclCurl will not and cannot report an error for  this. Using  '\fBverbose\fP'
731 will get a warning to display, but that is the only visible feedback you get
732 about this possibly lethal situation.
733
734 .TP
735 .B -cookiesession
736 Pass an 1 to mark this as a new cookie "session". It will
737 force TclCurl to ignore all cookies it is about to load that are "session
738 cookies" from the previous session. By default, TclCurl always stores and
739 loads all cookies, independent of whether they are session cookies are not.
740 Session cookies are cookies without expiry date and they are meant to be
741 alive and existing for this "session" only.
742
743 .TP
744 .B -cookielist
745 Pass a string with a cookie. The cookie can be either in Netscape / Mozilla
746 format or just regular HTTP-style header (Set-Cookie: ...) format. If the
747 cookie engine was not enabled it will be enabled.  Passing a
748 magic string "ALL" will erase all known cookies while "FLUSH" will write
749 all cookies known by TclCurl to the file specified by \fB-cookiejar\fP.
750
751 .TP
752 .B -httpget
753 If set to 1 forces the HTTP request to get back to GET, usable if
754 POST, PUT or a custom request have been used previously with the
755 same handle.
756
757 When setting \fBhttpget\fP to 1, \fBnobody\fP will automatically be set to 0.
758
759 .TP
760 .B -httpversion
761 Set to one of the values decribed below, they force TclCurl to use the
762 specific http versions. It should only be used if you really MUST do
763 that because of a silly remote server.
764 .RS
765 .TP 5
766 .B none
767 We do not care about what version the library uses. TclCurl will use whatever
768 it thinks fit.
769 .TP
770 .B 1.0
771 Enforce HTTP 1.0 requests.
772 .TP
773 .B 1.1
774 Enforce HTTP 1.1 requests.
775 .RE
776
777 .TP
778 .B -ignorecontentlength
779 Ignore the Content-Length header. This is useful for Apache 1.x (and similar
780 servers) which will report incorrect content length for files over 2
781 gigabytes. If this option is used, TclCurl will not be able to accurately
782 report progress, and will simply stop the download when the server ends the
783 connection.
784
785 .TP
786 .B -httpcontentdecoding
787 Set to zero to disable content decoding. If set to 1 it is enabled. Note however
788 that TclCurl has no default content decoding but requires you to use \fBencoding\fP for that.
789
790 .TP
791 .B -httptransferencoding
792 Set to zero to disable transfer decoding, if set to 1 it is enabled (default). TclCurl does
793 chunked transfer decoding by default unless this option is set to zero.
794
795 .SH FTP options
796
797 .TP
798 .B -ftpport
799 Pass a string as parameter. It will be used to
800 get the IP address to use for the ftp PORT instruction. The PORT instruction
801 tells the remote server to connect to our specified IP address. The string may
802 be a plain IP address, a host name, a network interface name (under unix) or
803 just a '-' to let the library use your systems default IP address. Default FTP
804 operations are passive, and thus will not use PORT.
805
806 .TP
807 .B -quote
808 Pass a \fBlist\fP list with the FTP or SFTP commands to pass to the server prior to your
809 ftp request. This will be done before any other FTP commands are issued (even
810 before the CWD command).If you do not want to transfer any files, set
811 \fBnobody\fP to '1' and \fBheader\fP to '0'.
812
813 Keep in mind the commands to send must be 'raw' ftp commands, for example, to
814 create a directory you need to send \fBmkd Test\fP, not \fBmkdir Test\fP.
815
816 Valid SFTP commands are: chgrp, chmod, chown, ln, mkdir, pwd, rename, rm,
817 rmdir and symlink. 
818
819 .TP
820 .B -postquote
821 Pass a \fBlist\fP with the FTP commands to pass to the server after your
822 ftp transfer request. If you do not want to transfer any files, set
823 \fBnobody\fP to '1' and \fBheader\fP to '0'.
824
825 .TP
826 .B -prequote
827 Pass a \fBlist\fP of FTP or SFTP commands to pass to the server after the
828 transfer type is set.
829
830 .TP
831 .B -dirlistonly
832 A 1 tells the library to just list the names of files in a
833 directory, instead of doing a full directory listing that would include file
834 sizes, dates etc. It works with both FTP and SFTP urls.
835
836 This causes an FTP NLST command to be sent. Beware that some FTP servers list
837 only files in their response to NLST, they might not include subdirectories
838 and symbolic links.
839
840 .TP
841 .B -append
842 A 1 parameter tells the extension to append to the remote file instead of
843 overwriting it. This is only useful when uploading to a ftp site.
844
845 .TP
846 .B -ftpuseeprt
847 Set to 1 to tell TclCurl to use the EPRT (and LPRT) command when doing
848 active FTP downloads (which is enabled by '\fBftpport\fP'). Using EPRT means
849 that it will first attempt to use EPRT and then LPRT before using PORT, if
850 you pass zero to this option, it will not try using EPRT or LPRT, only plain PORT.
851
852 .TP
853 .B -ftpuseepvs
854 Set to one to tell TclCurl to use the EPSV command when doing passive FTP
855 downloads (which it always does by default). Using EPSV means that it will
856 first attempt to use EPSV before using PASV, but if you pass a zero to this
857 option, it will not try using EPSV, only plain PASV.
858
859 .TP
860 .B -ftpcreatemissingdirs
861 If set to 1, TclCurl will attempt to create any remote directory that it
862 fails to CWD into. CWD is the command that changes working directory.
863
864 This setting also applies to SFTP-connections. TclCurl will attempt to create
865 the remote directory if it can't obtain a handle to the target-location. The
866 creation will fail if a file of the same name as the directory to create
867 already exists or lack of permissions prevents creation.
868
869 .TP
870 .B -ftpresponsetimeout
871 Causes TclCurl to set a timeout period (in seconds) on the amount of time that
872 the server is allowed to take in order to generate a response message for a
873 command before the session is considered hung. Note that while TclCurl is waiting
874 for a response, this value overrides \fBtimeout\fP. It is recommended that if used
875 in conjunction with \fBtimeout\fP, you set it to a value smaller than \fBtimeout\fP.
876
877 .TP
878 .B -ftpalternativetouser 
879 Pass a string which will be used to authenticate if the usual FTP "USER user" and
880 "PASS password" negotiation fails. This is currently only known to be required when
881 connecting to Tumbleweed's Secure Transport FTPS server using client certificates for
882 authentication.
883
884 .TP
885 .B -ftpskippasvip
886 If set to 1, it instructs TclCurl not to use the IP address the
887 server suggests in its 227-response to TclCurl's PASV command when TclCurl
888 connects the data connection. Instead TclCurl will re-use the same IP address
889 it already uses for the control connection. But it will use the port number
890 from the 227-response.
891
892 This option has no effect if PORT, EPRT or EPSV is used instead of PASV.
893
894 .TP
895 .B -usessl
896 You can use ftps:// URLs to explicitly switch on SSL/TSL for the control
897 connection and the data connection.
898
899 Alternatively, and what seems to be the recommended way, you can set the
900 option to one of these values:
901
902 .RS
903 .TP 5
904 .B nope
905 Do not attempt to use SSL
906 .TP
907 .B try
908 Try using SSL, proceed anyway otherwise.
909 .TP
910 .B control
911 Use SSL for the control conecction or fail with "use ssl failed" (64).
912 .TP
913 .B all
914 Use SSL for all communication or fail with "use ssl failed" (64).
915 .RE
916
917 .TP
918 .B -ftpsslauth
919
920 Pass TclCurl one of the values from below, to alter how TclCurl issues
921 "AUTH TLS" or "AUTH SSL" when FTP over SSL is activated (see \fB-ftpssl\fP).
922
923 You may need this option because of servers like BSDFTPD-SSL from
924 http://bsdftpd-ssl.sc.ru/ "which won't work properly  when "AUTH SSL" is issued
925 (although the server responds fine and everything) but requires "AUTH TLS"
926 instead".
927
928 .RS
929 .TP 5
930 .B default
931 Allows TclCurl to decide.
932 .TP
933 .B ssl
934 Try "AUTH SSL" first, and only if that fails try "AUTH TLS".
935 .TP
936 .B tls
937 Try "AUTH TLS" first, and only if that fails try "AUTH SSL".
938 .RE
939
940 .TP
941 .B -ftpsslccc 
942 Set it to make TclCurl use CCC (Clear Command Channel). It shuts down the
943 SSL/TLS layer after authenticating. The rest of the control channel
944 communication will be unencrypted. This allows NAT routers to follow the
945 FTP transaction. Possible values are:
946
947 .RS
948 .TP 5
949 .B none
950 Do not attempt to use CCC.
951 .TP
952 .B passive
953 Do not initiate the shutdown, wait for the server to do it. Do not send a reply. 
954 .TP
955 .B active
956 Initiate the shutdown and wait for a reply. 
957 .RE
958
959 .TP
960 .B -ftpaccount
961 Pass string (or "" to disable). When an FTP server asks for "account data" after
962 user name and password has been provided, this data is sent off using the ACCT
963 command.
964
965 .TP
966 .B -ftpfilemethod
967 It allows three values:
968 .RS
969 .TP 5
970 .B multicwd
971 The default, TclCurl will do a single CWD operation for each path part in the given
972 URL. For deep hierarchies this means very many commands. This is how RFC1738 says it
973 should be done.
974 .TP
975 .B nocwd
976 No CWD at all is done, TclCurl will do SIZE, RETR, STOR, etc and give a full path to
977 the server.
978 .TP
979 .B singlecwd
980 Make one CWD with the full target directory and then operate on the file "normally".
981 This is somewhat more standards compliant than 'nocwd' but without the full penalty of 'multicwd'.
982 .RE
983
984 .SH Protocol options
985
986 .TP
987 .B -transfertext
988 A 1 tells the extension to use ASCII mode for ftp transfers,
989 instead of the default binary transfer. For win32 systems it does not set the
990 stdout to binary mode. This option can be usable when transferring text data
991 between systems with different views on certain characters, such as newlines
992 or similar.
993
994 \fBNOTE:\fP TclCurl does not do a complete ASCII conversion when doing ASCII
995 transfers over FTP. This is a known limitation/flaw that nobody has
996 rectified. TclCurl simply sets the mode to ascii and performs a standard
997 transfer.
998
999 .TP
1000 .B -proxytransfermode
1001 If set to 1, TclCurl sets the transfer mode (binary or ASCII) for FTP transfers
1002 done via an HTTP proxy, by appending ;type=a or ;type=i to the URL.
1003 Without this setting, or it being set to 0, the default, \fB-transfertext\fP has
1004 no effect when doing FTP via a proxy. Beware that not all proxies support this feature.
1005
1006 .TP
1007 .B -crlf
1008 Convert unix newlines to CRLF newlines on FTP transfers.
1009
1010 .TP
1011 .B -range
1012 Pass a string as parameter, which should contain the specified range you
1013 want. It should be in the format
1014 .I "X-Y"
1015 , where X or Y may be left out. HTTP
1016 transfers also support several intervals, separated with commas as in
1017 .I "X-Y,N-M"
1018 Using this kind of multiple intervals will cause the HTTP server to send the
1019 response document in pieces (using standard MIME separation techniques).
1020
1021 Ranges only work on HTTP, FTP and FILE transfers.
1022
1023 .TP
1024 .B -resumefrom
1025 Pass the offset in number of bytes that you want the transfer to start from.
1026 Set this option to 0 to make the transfer start from the beginning
1027 (effectively disabling resume).
1028
1029 For FTP, set this option to -1 to make the transfer start from the end of the
1030 target file (useful to continue an interrupted upload). 
1031
1032 .TP
1033 .B -customrequest
1034 Pass a string as parameter. It will be used instead of GET or HEAD when doing
1035 the HTTP request. This is useful for doing DELETE or other more obscure HTTP
1036 requests. Do not do this at will, make sure your server supports the command first.
1037
1038 Note that TclCurl will still act and assume the keyword it would use if you
1039 do not set your custom and it will act according to that. Thus, changing this
1040 to a HEAD when TclCurl otherwise would do a GET might cause TclCurl to act funny,
1041 and similar. To switch to a proper HEAD, use \fB-nobody\fP, to switch to a proper
1042 POST, use \fB-post\fP or \fB-postfields\fP and so on.
1043
1044 .TP
1045 .B -filetime
1046 If you pass a 1, TclCurl will attempt to get the
1047 modification date of the remote document in this operation. This requires that
1048 the remote server sends the time or replies to a time querying command. The
1049 getinfo procedure with the
1050 .I filetime
1051 argument can be used after a transfer to extract the received time (if any).
1052
1053 .TP
1054 .B -nobody
1055 A 1 tells the library not to include the body-part in the
1056 output. This is only relevant for protocols that have a separate header and
1057 body part. On HTTP(S) servers, this will make TclCurl do a HEAD request.
1058
1059 To change request to GET, you should use \fBhttpget\fP. Change request
1060 to POST with \fBpost\fP etc.
1061
1062 .TP
1063 .B -infilesize
1064 When uploading a file to a remote site, this option should be used to tell
1065 TclCurl what the expected size of the infile is.
1066
1067 This option is mandatory for uploading using SCP.
1068
1069 .TP
1070 .B -upload
1071 A 1 tells the library to prepare for an upload. The
1072 \fB-infile\fP and \fB-infilesize\fP options are also interesting for uploads.
1073 If the protocol is HTTP, uploading means using the PUT request unless you tell
1074 TclCurl otherwise.
1075
1076 Using PUT with HTTP 1.1 implies the use of a "Expect: 100-continue" header.
1077 You can disable this header with \fB-httpheader\fP as usual.
1078
1079 If you use PUT to a HTTP 1.1 server, you can upload data without knowing the
1080 size before starting the transfer if you use chunked encoding. You enable this
1081 by adding a header like "Transfer-Encoding: chunked" with \fB-httpheader\fP.
1082 With HTTP 1.0 or without chunked transfer, you must specify the size.
1083
1084 .TP
1085 .B -maxfilesize
1086 This allows you to specify the maximum size (in bytes) of a file to download.
1087 If the file requested is larger than this value, the transfer will not start
1088 and error 'filesize exceeded' (63) will be returned.
1089
1090 NOTE: The file size is not always known prior to download, and for such files
1091 this option has no effect even if the file transfer ends up being larger than
1092 this given limit. This concerns both FTP and HTTP transfers.
1093
1094 .TP
1095 .B -timecondition
1096 This defines how the \fBtimevalue\fP value is treated. You can set this
1097 parameter to \fBifmodsince\fP or \fBifunmodsince\fP.  This feature applies to
1098 HTTP and FTP.
1099
1100 .TP
1101 .B -timevalue
1102 This should be the time in seconds since 1 jan 1970, and the time will be
1103 used in a condition as specified with \fBtimecondition\fP.
1104
1105
1106 .SH Connection options
1107
1108 .TP
1109 .B -timeout
1110 Pass the maximum time in seconds that you allow
1111 the TclCurl transfer operation to take. Do note that normally, name lookups
1112 may take a considerable time and that limiting the operation to less than a
1113 few minutes risks aborting perfectly normal operations. This option will
1114 cause libcurl to use the SIGALRM to enable time-outing system calls.
1115
1116 In unix-like systems, this might cause signals to be used unless
1117 \fB-nosignal\fP is used.
1118
1119 .TP
1120 .B -timeoutms
1121 Like \fBtimeout\fP but takes a number of milliseconds instead. If libcurl is
1122 built to use the standard system name resolver, that part will still use
1123 full-second resolution for timeouts.
1124
1125 .TP
1126 .B -lowspeedlimit
1127 Pass the speed in bytes per second that the transfer should be below during
1128 .B lowspeedtime
1129 seconds for the extension to consider it too slow and abort.
1130
1131 .TP
1132 .B -lowspeedtime
1133 Pass the time in seconds that the transfer should be below the
1134 .B lowspeedlimit
1135 for the extension to consider it too slow and abort.
1136
1137 .TP
1138 .B -maxsendspeed
1139 Pass a speed in bytes per seconds. If an upload exceeds this speed on cumulative
1140 average during the transfer, the transfer will pause to keep the average rate less
1141 than or equal to the parameter value.  Defaults to unlimited speed.
1142
1143 .TP
1144 .B -maxrecvspeed
1145 Pass a speed in bytes per second. If a download exceeds this speed on cumulative
1146 average during the transfer, the transfer will pause to keep the average rate less
1147 than or equal to the parameter value. Defaults to unlimited speed.
1148
1149 .TP
1150 .B -maxconnects
1151 Sets the persistant connection cache size in all the protocols that support 
1152 persistent conecctions. The set amount will be the maximum amount of simultaneous
1153 connections that TclCurl may cache in this easy handle. Default is 5, and there
1154 isn't much point in changing this value unless you are perfectly aware of how this
1155 work and changes TclCurl's behaviour.
1156
1157 When reaching the maximum limit, TclCurl closes the oldest connection in the cache
1158 to prevent the number of open connections to increase. 
1159
1160 \fBNote\fP: if you have already performed transfers with this curl handle,
1161 setting a smaller
1162 .B maxconnects
1163 than before may cause open connections to unnecessarily get closed.
1164
1165 \fBNote\fP that if you add this easy handle to a multi handle, this setting is not
1166 being acknowledged, instead you must configure the multi handle its own
1167 \fBmaxconnects\fP option.
1168
1169 .TP
1170 .B -connecttimeout
1171 Maximum time in seconds that you allow the
1172 connection to the server to take.  This only limits the connection phase, once
1173 it has connected, this option is of no more use. Set to zero to disable
1174 connection timeout (it will then only timeout on the internal timeouts).
1175
1176 In unix-like systems, this might cause signals to be used unless
1177 \fB-nosignal\fP is set.
1178
1179 .TP
1180 .B -connecttimeoutms
1181 Like \fBconnecttimeout\fP but takes a number of milliseconds instead. If libcurl
1182 is built to use the standard system name resolver, that part will still use
1183 full-second resolution for timeouts.
1184
1185 .TP
1186 .B -ipresolve
1187 Allows an application to select what kind of IP addresses to use when
1188 resolving host names. This is only interesting when using host names
1189 that resolve addresses using more than one version of IP. The allowed
1190 values are:
1191 .RS
1192 .TP 5
1193 .B whatever
1194 Default, resolves addresses to all IP versions that your system allows.
1195 .TP
1196 .B v4
1197 Resolve to ipv4 addresses.
1198 .TP
1199 .B v6
1200 Resolve to ipv6 addresses.
1201 .RE
1202
1203 .SH SSL and security options
1204
1205 .TP
1206 .B -sslcert
1207 Pass a string as parameter. The string should be the file name of your certificate.
1208 The default format is "PEM" and can be changed with \fB-sslcerttype\fP.
1209
1210 With NSS this is the nickname of the certificate you wish to authenticate with.
1211
1212 .TP
1213 .B -sslcerttype
1214 Pass a string as parameter. The string should be the format of your certificate.
1215 Supported formats are "PEM" and "DER".
1216
1217 .TP
1218 .B -sslkey
1219 Pass a pointer to a zero terminated string as parameter. The string should be
1220 the file name of your private key. The default format is "PEM" and can be
1221 changed with \fB-sslkeytype\fP.
1222
1223 .TP
1224 .B -sslkeytype
1225 Pass a pointer to a zero terminated string as parameter. The string should be
1226 the format of your private key. Supported formats are "PEM", "DER" and "ENG"
1227
1228 \fBNOTE:\fPThe format "ENG" enables you to load the private key from a crypto
1229 engine. in this case \fB-sslkey\fP is used as an identifier passed to
1230 the engine. You have to set the crypto engine with \fB-sslengine\fP. The "DER"
1231 format key file currently does not work because of a bug in OpenSSL.
1232
1233 .TP
1234 .B -keypasswd
1235 Pass a string as parameter. It will be used as the password required to use the
1236 \fB-sslkey\fP or \fB-sshprivatekeyfile\fP private key.
1237
1238 You never need a pass phrase to load a certificate but you need one to load you
1239 private key. 
1240
1241 This option used to be known as \fB-sslkeypasswd\fP and \fB-sslcertpasswd\fP.
1242
1243 .TP
1244 .B -sslengine
1245 Pass a string as parameter. It will be used as the identifier for the crypto
1246 engine you want to use for your private key.
1247
1248 \fBNOTE:\fPIf the crypto device cannot be loaded, an error will be returned.
1249
1250 .TP
1251 .B -sslenginedefault
1252 Pass a 1 to set the actual crypto engine as the default for (asymmetric) crypto operations.
1253
1254 \fBNOTE:\fPIf the crypto device cannot be set, an error will be returned.
1255
1256 .TP
1257 .B -sslversion
1258 Use it to set what version of SSL/TLS to use. The available options are: 
1259 .RS
1260 .TP 5
1261 .B default
1262 The default action. This will attempt to figure out the remote SSL protocol version,
1263 i.e. either SSLv3 or TLSv1 (but not SSLv2, which became disabled by default with 7.18.1). 
1264 .TP
1265 .B tlsv1
1266 Force TLSv1
1267 .TP
1268 .B sslv2
1269 Force SSLv2
1270 .TP
1271 .B sslv3
1272 Force SSLv3
1273 .RE
1274
1275 .TP
1276 .B -sslverifypeer
1277 This option determines whether TclCurl verifies the authenticity of the peer's certificate.
1278 A 1 means it verifies; zero means it doesn't. The default is 1. 
1279
1280 When negotiating an SSL connection, the server sends a certificate indicating its identity.
1281 TclCurl verifies whether the certificate is authentic, i.e. that you can trust that the
1282 server is who the certificate says it is. This trust is based on a chain of digital signatures,
1283 rooted in certification authority (CA) certificates you supply.
1284
1285 TclCurl uses a default bundle of CA certificates that comes with libcurl but you can specify
1286 alternate certificates with the \fB-cainfo\fP or the \fB-capath\fP options.
1287
1288 When \fB-sslverifypeer\fP is nonzero, and the verification fails to prove that the certificate
1289 is authentic, the connection fails. When the option is zero, the connection succeeds regardless. 
1290
1291 Authenticating the certificate is not by itself very useful. You typically want to ensure
1292 that the server, as authentically identified by its certificate, is the server you mean to
1293 be talking to, use \fB-sslverifyhost\fP to control that.
1294
1295 .TP
1296 .B -cainfo
1297 Pass a file naming holding the certificate to verify the peer with. This only
1298 makes sense when used in combination with the \fB-sslverifypeer\fP option, if
1299 it is set to zero \fB-cainfo\fP need not even indicate an accessible file.
1300
1301 When built against NSS this is the directory that the NSS certificate database
1302 resides in.
1303
1304 .TP
1305 .B -issuercert
1306 Pass a string naming a file holding a CA certificate in PEM format. If the option
1307 is set, an additional check against the peer certificate is performed to verify
1308 the issuer is indeed the one associated with the certificate provided by the option.
1309 This additional check is useful in multi-level PKI where one need to enforce the peer
1310 certificate is from a specific branch of the tree.
1311  
1312 This option makes sense only when used in combination with the \fB-sslverifypeer\fP
1313 option. Otherwise, the result of the check is not considered as failure.
1314
1315 .TP
1316 .B -capath
1317 Pass the directory holding multiple CA certificates to verify the peer with.
1318 The certificate directory must be prepared using the openssl c_rehash utility.
1319 This only makes sense when used in combination with the  \fB-sslverifypeer\fP
1320 option, if it is set to zero, \fB-capath\fP need not even indicate an accessible
1321 path.
1322
1323 This option apparently does not work in Windows due to some limitation in openssl.
1324
1325 This option is OpenSSL-specific and does nothing if libcurl is built to use GnuTLS.
1326
1327 .TP
1328 .B -crlfile
1329 Pass a string naming a file with the concatenation of CRL (in PEM format) to use in
1330 the certificate validation that occurs during the SSL exchange.
1331  
1332 When libcurl is built to use NSS or GnuTLS, there is no way to influence the use of
1333 CRL passed to help in the verification process. When built with OpenSSL support,
1334 X509_V_FLAG_CRL_CHECK and X509_V_FLAG_CRL_CHECK_ALL are both set, requiring CRL
1335 check against all the elements of the certificate chain if a CRL file is passed.
1336  
1337 This option makes sense only when used in combination with the \fB-sslverifypeer\fP
1338 option. 
1339
1340 .TP
1341 .B -randomfile
1342 Pass a file name. The file will be used to read from to seed the random engine
1343 for SSL. The more random the specified file is, the more secure will the SSL
1344 connection become.
1345
1346 .TP
1347 .B -egdsocket
1348 Pass a path name to the Entropy Gathering Daemon socket. It will be used to seed
1349 the random engine for SSL.
1350
1351 .TP
1352 .B -sslverifyhost
1353 This option determines whether TclCurl verifies that the server claims to be
1354 who you want it to be.
1355
1356 When negotiating an SSL connection, the server sends a certificate
1357 indicating its identity.
1358
1359 When \fB-sslverifyhost\fP is set to 2, that certificate must indicate
1360 that the server is the server to which you meant to connect, or the
1361 connection fails.
1362
1363 TclCurl considers the server the intended one when the Common Name field
1364 or a Subject Alternate Name field in the certificate matches the host
1365 name in the URL to which you told Curl to connect.
1366
1367 When set to 1, the certificate must contain a Common Name field,
1368 but it does not matter what name it says. (This is not ordinarily a
1369 useful setting).
1370
1371 When the value is 0, the connection succeeds regardless of the names in
1372 the certificate.
1373
1374 The default is 2.
1375
1376 This option controls the identity that the server \fIclaims\fP. The server
1377 could be lying. To control lying, see \fBsslverifypeer\fP.
1378
1379 .TP
1380 .B -sslcypherlist
1381 Pass a string holding the ciphers to use for the SSL connection. The list must
1382 consists of one or more cipher strings separated by colons. Commas or spaces
1383 are also acceptable separators but colons are normally used, , - and + can be
1384 used as operators. 
1385
1386 For OpenSSL and GnuTLS valid examples of cipher lists include 'RC4-SHA', 'SHA1+DES',
1387 'TLSv1' and 'DEFAULT'. The default list is normally set when you compile OpenSSL.
1388
1389 You will find more details about cipher lists on this URL:
1390     http://www.openssl.org/docs/apps/ciphers.html
1391
1392 For NSS valid examples of cipher lists include 'rsa_rc4_128_md5', 'rsa_aes_128_sha',
1393 etc. With NSS you don't add/remove ciphers. If you use this option then all known
1394 ciphers are disabled and only those passed in are enabled.
1395  
1396 You'll find more details about the NSS cipher lists on this URL:
1397     http://directory.fedora.redhat.com/docs/mod_nss.html
1398
1399 .TP
1400 .B -sslsessionidcache
1401 Pass a 0 to disable TclCurl's use of SSL session-ID caching or a 1 to enable it.
1402 By default all transfers are done using the cache. Note that while nothing ever
1403 should get hurt by attempting to reuse SSL session-IDs, there seem to be broken SSL
1404 implementations in the wild that may require you to disable this in order for you to
1405 succeed.
1406
1407 .TP
1408 .B -krblevel
1409 Set the kerberos security level for FTP, this also enables kerberos awareness.
1410 This is a string, 'clear', 'safe', 'confidential' or 'private'. If the string
1411 is set but does not match one of these, 'private' will be used. Set the string
1412 to NULL to disable kerberos4. Set the string to "" to disable kerberos
1413 support for FTP.
1414
1415 .SH SSH options
1416
1417 .TP
1418 .B -sshauthtypes
1419 The allowed types are:
1420
1421 .RS
1422 .TP 5
1423 .B publickey
1424 .TP
1425 .B password
1426 .TP
1427 .B host
1428 .TP
1429 .B keyboard
1430 .TP
1431 .B any
1432 To let TclCurl pick one
1433 .RE
1434
1435 .TP
1436 .B -sshhostpublickeymd5
1437 Pass a string containing 32 hexadecimal digits. The string should be the 128
1438 bit MD5 cheksum of the remote host public key, and TclCurl will reject the
1439 connection to the host unless the md5sums match. This option is only for SCP
1440 and SFTP transfers.
1441
1442 .TP
1443 .B -publickeyfile
1444 Pass the file name for your public key. If not used, TclCurl defaults to using \fB~/.ssh/id_dsa.pub\fP.
1445
1446 .TP
1447 .B -privatekeyfile
1448 Pass the file name for your private key. If not used, TclCurl defaults to using \fB~/.ssh/id_dsa\fP.
1449 If the file is password-protected, set the password with \fB-keypasswd\fP.
1450
1451 .SH Other options
1452
1453 .TP
1454 .B -headervar
1455 Name of the Tcl array variable where TclCurl will store the headers returned
1456 by the server.
1457
1458 When a server sends a chunked encoded transfer, it may contain a
1459 trailer. That trailer is identical to a HTTP header and if such a trailer is
1460 received it is passed to the application using this callback as well. There
1461 are several ways to detect it being a trailer and not an ordinary header: 1)
1462 it comes after the response-body. 2) it comes after the final header line (CR
1463 LF) 3) a Trailer: header among the response-headers mention what header to
1464 expect in the trailer.
1465
1466 .TP
1467 .B -bodyvar
1468 Name of the Tcl variable where TclCurl will store the file requested, the file
1469 may contain text or binary data.
1470
1471 .TP
1472 .B -canceltransvar
1473 Name of a Tcl variable, in case you have defined a procedure to call with
1474 \fB-progressproc\fP setting this variable to '1' will cancel the transfer.
1475
1476 .TP
1477 .B -command
1478 Executes the given command after the transfer is done, since it only works
1479 with blocking transfers, it is pretty much useless.
1480
1481 .TP
1482 .B -share
1483 Pass a share handle as a parameter. The share handle must have been created by
1484 a previous call to \fBcurl::shareinit\fP. Setting this option, will make this
1485 handle use the data from the shared handle instead of keeping the data to itself.
1486 See \fItclcurl_share\fP for details.
1487
1488 .TP
1489 .B -newfileperms
1490 Pass a number as a parameter, containing the value of the permissions that will
1491 be assigned to newly created files on the remote server. The default value is 0644,
1492 but any valid value can be used. The only protocols that can use this are sftp://,
1493 scp:// and file://.
1494
1495 .TP
1496 .B -newdirectoryperms
1497 Pass a number as a parameter, containing the value of the permissions that will be
1498 assigned to newly created directories on the remote server. The default value is 0755,
1499 but any valid value can be used. The only protocols that can use this are sftp://, scp://
1500 and file://.
1501
1502 .SH NOT SUPPORTED
1503 Some of the options libcurl offers are not supported, I don't think them
1504 worth supporting in TclCurl but if you need one of them don't forget to
1505 complain:
1506 .sp
1507 .B CURLOPT_FRESH_CONNECT, CURLOPT_FORBID_REUSE, CURLOPT_PRIVATE,
1508 .B CURLOPT_SSL_CTX_FUNCTION, CURLOPT_SSL_CTX_DATA, CURLOPT_SSL_CTX_FUNCTION and
1509 .B CURLOPT_CONNECT_ONLY, CURLOPT_OPENSOCKETFUNCTION, CURLOPT_OPENSOCKETDATA.
1510
1511 .SH curlHandle perform
1512 This procedure is called after the
1513 .B init
1514 and all the
1515 .B configure
1516 calls are made, and will perform the transfer as described in the options.
1517 .sp
1518 It must be called with the same
1519 \fIcurlHandle\fP \fBcurl::init\fP call returned.
1520 You can do any amount of calls to perform while using the same handle. If you
1521 intend to transfer more than one file, you are even encouraged to do
1522 so. TclCurl will then attempt to re-use the same connection for the following
1523 transfers, thus making the operations faster, less CPU intense and using less
1524 network resources. Just note that you will have to use
1525 .I configure
1526 between the invokes to set options for the following perform.
1527 .sp
1528 You must never call this procedure simultaneously from two places using the
1529 same handle. Let it return first before invoking it another time. If
1530 you want parallel transfers, you must use several curl handles.
1531 .TP
1532 .B RETURN VALUE
1533 '0' if all went well, non-zero if it didn't. In case of error, if the
1534 .I errorbuffer
1535 was set with
1536 .I configure
1537 there will be a readable error message.
1538 The error codes are:
1539 .IP 1
1540 Unsupported protocol. This build of TclCurl has no support for this protocol.
1541 .IP 2
1542 Very early initialization code failed. This is likely to be and internal error
1543 or problem.
1544 .IP 3
1545 URL malformat. The syntax was not correct.
1546 .IP 5
1547 Couldn't resolve proxy. The given proxy host could not be resolved.
1548 .IP 6
1549 Couldn't resolve host. The given remote host was not resolved.
1550 .IP 7
1551 Failed to connect to host or proxy.
1552 .IP 8
1553 FTP weird server reply. The server sent data TclCurl couldn't parse.
1554 The given remote server is probably not an OK FTP server.
1555 .IP 9
1556 We were denied access to the resource given in the URL. For FTP, this occurs
1557 while trying to change to the remote directory.
1558 .IP 11
1559 FTP weird PASS reply. TclCurl couldn't parse the reply sent to the PASS request.
1560 .IP 13
1561 FTP weird PASV reply, TclCurl couldn't parse the reply sent to the PASV or EPSV
1562 request.
1563 .IP 14
1564 FTP weird 227 format. TclCurl couldn't parse the 227-line the server sent.
1565 .IP 15
1566 FTP can't get host. Couldn't resolve the host IP we got in the 227-line.
1567 .IP 17
1568 FTP couldn't set type. Couldn't change transfer method to either binary or
1569 ascii.
1570 .IP 18
1571 Partial file. Only a part of the file was transfered, this happens when
1572 the server first reports an expected transfer size and then delivers data
1573 that doesn't match the given size.
1574 .IP 19
1575 FTP couldn't RETR file, we either got a weird reply to a 'RETR' command or
1576 a zero byte transfer.
1577 .IP 21
1578 Quote error. A custom 'QUOTE' returned error code 400 or higher (for FTP) or
1579 otherwise indicated unsuccessful completion of the command.
1580 .IP 22
1581 HTTP returned error. This return code only appears if \fB-failonerror\fP is
1582 used and the HTTP server returns an error code that is 400 or higher.
1583 .IP 23
1584 Write error. TclCurl couldn't write data to a local filesystem or an error
1585 was returned from a write callback.
1586 .IP 25
1587 Failed upload failed. For FTP, the server typcially denied the STOR
1588 command. The error buffer usually contains the server's explanation to this.
1589 .IP 26
1590 Read error. There was a problem reading from a local file or an error was returned
1591 from the read callback.
1592 .IP 27
1593 Out of memory. A memory allocation request failed. This should never happen unless
1594 something weird is going on in your computer.
1595 .IP 28
1596 Operation timeout. The specified time-out period was reached according to the
1597 conditions.
1598 .IP 30
1599 The FTP PORT command failed, not all FTP servers support the PORT command,
1600 try  doing a transfer using PASV instead!.
1601 .IP 31
1602 FTP couldn't use REST. This command is used for resumed FTP transfers.
1603 .IP 33
1604 Range error. The server doesn't support or accept range requests.
1605 .IP 34
1606 HTTP post error. Internal post-request generation error.
1607 .IP 35
1608 SSL connect error. The SSL handshaking failed, the error buffer may have
1609 a clue to the reason, could be certificates, passwords, ...
1610 .IP 36
1611 FTP bad download resume. Couldn't continue an earlier aborted download, probably
1612 because you are trying to resume beyond the file size.
1613 .IP 37
1614 A file given with FILE:// couldn't be read. Did you checked the permissions?
1615 .IP 38
1616 LDAP cannot bind. LDAP bind operation failed.
1617 .IP 39
1618 LDAP search failed.
1619 .IP 41
1620 A required zlib function was not found.
1621 .IP 42
1622 Aborted by callback. An application told TclCurl to abort the operation.
1623 .IP 43
1624 Internal error. A function was called with a bad parameter.
1625 .IP 45
1626 Interface error. A specified outgoing interface could not be used.
1627 .IP 47
1628 Too many redirects. When following redirects, TclCurl hit the maximum amount, set
1629 your limit with --maxredirs
1630 .IP 48
1631 Unknown TELNET option specified.
1632 .IP 49
1633 A telnet option string was illegally formatted.
1634 .IP 51
1635 The remote peer's SSL certificate or SSH md5 fingerprint wasn't ok
1636 .IP 52
1637 The server didn't reply anything, which here is considered an error.
1638 .IP 53
1639 The specified crypto engine wasn't found.
1640 .IP 54
1641 Failed setting the selected SSL crypto engine as default!
1642 .IP 55
1643 Failed sending network data.
1644 .IP 56
1645 Failure with receiving network data.
1646 .IP 58
1647 Problem with the local client certificate.
1648 .IP 59
1649 Couldn't use specified SSL cipher.
1650 .IP 60
1651 Peer certificate cannot be authenticated with known CA certificates.
1652 .IP 61
1653 Unrecognized transfer encoding.
1654 .IP 62
1655 Invalid LDAP URL.
1656 .IP 63
1657 Maximum file size exceeded.
1658 .IP 64
1659 SSL use failed.
1660 .IP 65
1661 Sending the data requires a rewind that failed, since TclCurl should
1662 take care of it for you, it means you found a bug.
1663 .IP 66
1664 Failed to initialise ssl engine.
1665 .IP 67
1666 Failed to login, user password or similar was not accepted.
1667 .IP 68
1668 File not found on TFTP server.
1669 .IP 69
1670 There is a permission problem with the TFTP request.
1671 .IP 70
1672 The remote server has run out of space.
1673 .IP 71
1674 Illegal TFTP operation.
1675 .IP 72
1676 Unknown transfer ID.
1677 .IP 73
1678 TFTP file already exists and will not be overwritten.
1679 .IP 74
1680 No such user in the TFTP server and good behaving TFTP server
1681 should never return this.
1682 .IP 75
1683 Character conversion failed.
1684 .IP 77
1685 Problem with reading the SSL CA cert (path? access rights?).
1686 .IP 78
1687 Remote file not found
1688 .IP 79
1689 Error from the SSH layer
1690 .IP 80
1691 Failed to shut down the SSL connection
1692 .IP 82
1693 Failed to load CRL file
1694 .IP 83
1695 Issuer check failed
1696
1697 .SH curlHandle getinfo option
1698 Request internal information from the curl session with this procedure.
1699 This procedure is intended to get used *AFTER* a performed transfer,
1700 and can be relied upon only if the \fBperform\fP returns 0.  Use
1701 this function AFTER a performed transfer if you want to get
1702 transfer-oriented data.
1703
1704 The following information can be extracted:
1705
1706 .TP
1707 .B effectiveurl
1708 Returns the last used effective URL.
1709
1710 .TP
1711 .B responsecode
1712 Returns the last received HTTP or FTP code. This will be zero if no server
1713 response code has been received. Note that a proxy's CONNECT response should
1714 be read with \fBhttpconnectcode\fP and not this.
1715
1716 .TP
1717 .B httpconnectcode
1718 Returns the last received proxy response code to a CONNECT request.
1719
1720 .TP
1721 .B filetime
1722 Returns the remote time of the retrieved document (in number of seconds
1723 since 1 jan 1970 in the GMT/UTC time zone). If you get -1,
1724 it can be because of many reasons (unknown, the server hides it or the
1725 server doesn't support the command that tells document time etc) and the time
1726 of the document is unknown.
1727 .sp
1728 In order for this to work you have to set the \fB-filetime\fP option before
1729 the transfer.
1730
1731 .TP
1732 .B namelookuptime
1733 Returns the time, in seconds, it took from the start until the name resolving
1734 was completed.
1735
1736 .TP
1737 .B connecttime
1738 Returns the time, in seconds, it took from the start until the connect to the
1739 remote host (or proxy) was completed.
1740
1741 .TP
1742 .B appconnecttime
1743 Returns the time, in seconds, it took from the start until the SSL/SSH
1744 connect/handshake to the remote host was completed. This time is most often very
1745 near to the PRETRANSFER time, except for cases such as HTTP pippelining where the
1746 pretransfer time can be delayed due to waits in line for the pipeline and more.
1747
1748 .TP
1749 .B pretransfertime
1750 Returns the time, in seconds, it took from the start until the file transfer
1751 is just about to begin. This includes all pre-transfer commands and
1752 negotiations that are specific to the particular protocol(s) involved.
1753
1754 .TP
1755 .B starttransfertime
1756 Returns the time, in seconds, it took from the start until the first byte
1757 is just about to be transfered. This includes the \fBpretransfertime\fP,
1758 and also the time the server needs to calculate the result.
1759
1760 .TP
1761 .B totaltime
1762 Returns the total transaction time, in seconds, for the previous transfer,
1763 including name resolving, TCP connect etc.
1764
1765 .TP
1766 .B redirecturl
1767 Returns the URL a redirect would take you to if you enable \fBfollowlocation\fP.
1768 This can come very handy if you think using the built-in libcurl redirect logic
1769 isn't good enough for you but you would still prefer to avoid implementing all
1770 the magic of figuring out the new URL.
1771
1772 .TP
1773 .B redirecttime
1774 Returns the total time, in seconds, it took for all redirection steps
1775 including name lookup, connect, pretransfer and transfer before
1776 the final transaction was started, it returns the complete execution
1777 time for multiple redirections, so it returns zero if no redirections
1778 were needed.
1779
1780 .TP
1781 .B redirectcount
1782 Returns the total number of redirections that were actually followed.
1783
1784 .TP
1785 .B numconnects
1786 Returns how many new connections TclCurl had to create to achieve the
1787 previous transfer (only the successful connects are counted). Combined
1788 with \fBredirectcount\fP you are able to know how many times TclCurl
1789 successfully reused existing connection(s) or not. See the Connection
1790 Options of \fBsetopt\fP to see how TclCurl tries to make persistent
1791 connections to save time.
1792
1793 .TP
1794 .B primaryip
1795 Returns the IP address of the most recent connection done with this handle.
1796 This string may be IPv6 if that's enabled.
1797
1798 .TP
1799 .B sizeupload
1800 Returns the total amount of bytes that were uploaded.
1801
1802 .TP
1803 .B sizedownload
1804 Returns the total amount of bytes that were downloaded. The amount is only
1805 for the latest transfer and will be reset again for each new transfer.
1806
1807 .TP
1808 .B speeddownload
1809 Returns the average download speed, measured in bytes/second, for the complete download.
1810
1811 .TP
1812 .B speedupload
1813 Returns the average upload speed, measured in bytes/second, for the complete upload.
1814
1815 .TP
1816 .B headersize
1817 Returns the total size in bytes of all the headers received.
1818
1819 .TP
1820 .B requestsize
1821 Returns the total size of the issued requests. This is so far only for HTTP
1822 requests. Note that this may be more than one request if followLocation is true.
1823
1824 .TP
1825 .B sslverifyresult
1826 Returns the result of the certification verification that was requested
1827 (using the -sslverifypeer option to configure).
1828
1829 .TP
1830 .B sslengines
1831 Returns a \fBlist\fP of the OpenSSL crypto-engines supported. Note that engines are
1832 normally implemented in separate dynamic libraries. Hence not all the returned
1833 engines may be available at run-time.
1834
1835 .TP
1836 .B contentlengthdownload
1837 Returns the content-length of the download. This is the value read from the
1838 .B Content-Length:
1839 field.
1840
1841 .TP
1842 .B contentlengthupload
1843 Returns the specified size of the upload.
1844
1845 .TP
1846 .B contenttype
1847 Returns the content-type of the downloaded object. This is the value
1848 read from the Content-Type: field. If you get an empty string, it  means
1849 the server didn't send a valid Content-Type header or that the protocol
1850 used doesn't support this.
1851
1852 .TP
1853 .B httpauthavail
1854 Returns a list with the authentication method(s) available.
1855
1856 .TP
1857 .B proxyauthavail
1858 Returns a list with the authentication method(s) available for your
1859 proxy athentication.
1860
1861 .TP
1862 .B oserrno
1863 Returns the errno value from a connect failure.
1864
1865 .TP
1866 .B cookielist
1867 Returns a list of all cookies TclCurl knows (expired ones, too). If there
1868 are no cookies (cookies for the handle have not been enabled or simply
1869 none have been received) the list will be empty.
1870
1871 .TP
1872 .B ftpentrypath 
1873 Returns a string holding the path of the entry path. That is the initial path
1874 TclCurl ended up in when logging on to the remote FTP server. Returns an empty
1875 string if something is wrong.
1876
1877 .SH curlHandle cleanup
1878 This procedure must be the last one to call for a curl session. It is the
1879 opposite of the
1880 .I curl::init
1881 procedure and must be called with the same
1882 .I curlhandle
1883 as input as the curl::init call returned.
1884 This will effectively close all connections TclCurl has used and possibly
1885 has kept open until now. Don't call this procedure if you intend to transfer
1886 more files.
1887
1888 .SH curlHandle reset
1889
1890 Re-initializes all options previously set on a specified handle to the
1891 default values.
1892
1893 This puts back the handle to the same state as it was in when it was just
1894 created with curl::init.
1895
1896 It does not change the following information kept in the handle: live
1897 connections, the Session ID cache, the DNS cache, the cookies and shares.
1898
1899 .SH curlHandle duphandle
1900 This procedure will return a new curl handle, a duplicate,
1901 using all the options previously set in the input curl handle.
1902 Both handles can subsequently be used independently and
1903 they must both be freed with
1904 .B cleanup.
1905 The new handle will not inherit any state information,
1906 connections, SSL sessions or cookies.
1907 .TP
1908 .B RETURN VALUE
1909 A new curl handle or an error message if the copy fails.
1910
1911 .SH curlHandle pause
1912 You can use this command from within a progress callback procedure
1913 to pause the transfer.
1914
1915 .SH curlHandle resume
1916 Resumes a transfer paused with \fBcurlhandle pause\fP
1917
1918 .SH curl::transfer
1919 In case you do not want to use persistant connections you can use this
1920 command, it takes the same arguments as the \fIcurlHandle\fP \fBconfigure\fP
1921 and will init, configure, perform and cleanup a connection for you.
1922
1923 You can also get the \fIgetinfo\fP information by using \fI-infooption variable\fP
1924 pairs, after the transfer \fIvariable\fP will contain the value that would have
1925 been returned by \fI$curlHandle getinfo option\fP.
1926 .TP
1927 .B RETURN VALUE
1928 The same error code \fBperform\fP would return.
1929
1930 .SH curl::version
1931 Returns a string with the version number of tclcurl, libcurl and some of
1932 its important components (like OpenSSL version).
1933 .TP
1934 .B RETURN VALUE
1935 The string with the version info.
1936
1937 .SH curl::escape url
1938 This procedure will convert the given input string to an URL encoded string and
1939 return that. All input characters that are not a-z,
1940 A-Z or 0-9 will be converted to their "URL escaped" version (%NN where NN is a
1941 two-digit hexadecimal number)
1942 .TP
1943 .B RETURN VALUE
1944 The converted string.
1945 .SH curl::unescape url
1946 This procedure will convert the given URL encoded input string to a "plain
1947 string" and return that. All input characters that
1948 are URL encoded (%XX where XX is a two-digit hexadecimal number) will be
1949 converted to their plain text versions.
1950 .TP
1951 .B RETURN VALUE
1952 The string unencoded.
1953
1954 .SH curl::curlConfig option
1955 Returns some information about how you have
1956 .B cURL
1957 installed.
1958
1959 .TP
1960 .B -prefix
1961 Returns the directory root where you installed
1962 .B cURL
1963 .TP
1964 .B -feature
1965 Returns a list containing particular main features the installed
1966 .B libcurl
1967 was built with. The list may include SSL, KRB4 or IPv6, do not
1968 assume any particular order.
1969 .TP
1970 .B -vernum
1971 Outputs  version  information  about  the installed libcurl, in
1972 numerical mode.  This outputs the  version  number,  in hexadecimal,
1973 with 8 bits for each part; major, minor, patch. So  that  libcurl
1974 7.7.4 would appear as 070704 and libcurl 12.13.14 would appear as
1975 0c0d0e...
1976
1977 .SH curl::versioninfo option
1978 Returns information about various run-time features in TclCurl.
1979
1980 Applications should use this information to judge if things are possible to do
1981 or not, instead of using compile-time checks, as dynamic/DLL libraries can be
1982 changed independent of applications.
1983
1984 .TP
1985 .B -version
1986 Returns the version of libcurl we are using.
1987
1988 .TP
1989 .B -versionnum
1990 Retuns the version of libcurl we are using in hexadecimal with 8 bits for each
1991 part; major, minor, patch. So  that  libcurl 7.7.4 would appear as 070704 and
1992 libcurl 12.13.14 would appear as 0c0d0e... Note that the initial zero might be
1993 omitted.
1994
1995 .TP
1996 .B -host
1997 Returns a string with the host information as discovered by a configure
1998 script or set by the build environment.
1999
2000 .TP
2001 .B -features
2002 Returns a list with the features compiled into libcurl, the possible elements are:
2003 .RS
2004 .TP 5
2005 .B ASYNCHDNS
2006 Libcurl was built with support for asynchronous name lookups, which allows
2007 more exact timeouts (even on Windows) and less blocking when using the multi
2008 interface.
2009 .TP
2010 .B CONV
2011 Libcurl was built with support for character conversions.
2012 .TP
2013 .B DEBUG
2014 Libcurl was built with extra debug capabilities built-in. This is mainly of
2015 interest for libcurl hackers. 
2016 .TP
2017 .B GSSNEGOTIATE
2018 Supports HTTP GSS-Negotiate.
2019 .TP
2020 .B IDN
2021 Supports IDNA, domain names with international letters.
2022 .TP
2023 .B IPV6
2024 Supports IPv6.
2025 .TP
2026 .B KERBEROS4
2027 Supports kerberos4 (when using FTP).
2028 .TP
2029 .B LARGEFILE
2030 Libcurl was built with support for large files.
2031 .TP
2032 .B LIBZ
2033 Supports HTTP deflate using libz.
2034 .TP
2035 .B NTML
2036 Supports HTTP NTLM
2037 .TP
2038 .B SPNEGO
2039 Libcurl was built with support for SPNEGO authentication (Simple and Protected
2040 GSS-API Negotiation Mechanism, defined in RFC 2478)
2041 .TP
2042 .B SSL
2043 Supports SSL (HTTPS/FTPS)
2044 .TP
2045 .B SSPI
2046 Libcurl was built with support for SSPI. This is only available on Windows and
2047 makes libcurl use Windows-provided functions for NTLM authentication. It also
2048 allows libcurl to use the current user and the current user's password without
2049 the app having to pass them on.
2050 .RE
2051 Do not assume any particular order.
2052
2053 .TP
2054 .B -sslversion
2055 Returns a string with the OpenSSL version used, like OpenSSL/0.9.6b.
2056
2057 .TP
2058 .B -sslversionnum
2059 Returns the numerical OpenSSL version value as defined by the OpenSSL project.
2060 If libcurl has no SSL support, this is 0.
2061
2062 .TP
2063 .B -libzversion
2064 Returns a string, there is no numerical  version, for example: 1.1.3.
2065
2066 .TP
2067 .B -protocols
2068 Lists what particular protocols the installed TclCurl was built to support.
2069 At the time of writing, this list may include HTTP, HTTPS, FTP, FTPS,
2070 FILE, TELNET, LDAP, DICT. Do not assume any particular order. The protocols
2071 will be listed using uppercase. There may be none, one or several protocols
2072 in the list.
2073
2074 .SH curl::easystrerror errorCode
2075 This procedure returns a string describing the error code passed in the argument.
2076
2077 .SH "SEE ALSO"
2078 .I curl, The art of HTTP scripting (at http://curl.haxx.se), RFC 2396,