some more
[platform/upstream/curl.git] / docs / MANUAL
1 LATEST VERSION
2
3   You always find news about what's going on as well as the latest versions
4   from the curl web pages, located at:
5
6         http://curl.haxx.se
7
8 SIMPLE USAGE
9
10   Get the main page from netscape's web-server:
11
12         curl http://www.netscape.com/
13
14   Get the root README file from funet's ftp-server:
15
16         curl ftp://ftp.funet.fi/README
17
18   Get a web page from a server using port 8000:
19
20         curl http://www.weirdserver.com:8000/
21
22   Get a list of the root directory of an FTP site:
23
24         curl ftp://cool.haxx.se/
25
26   Get a gopher document from funet's gopher server:
27
28         curl gopher://gopher.funet.fi
29
30   Get the definition of curl from a dictionary:
31
32         curl dict://dict.org/m:curl
33
34   Fetch two documents at once:
35
36         curl ftp://cool.haxx.se/ http://www.weirdserver.com:8000/
37
38 DOWNLOAD TO A FILE
39
40   Get a web page and store in a local file:
41
42         curl -o thatpage.html http://www.netscape.com/
43
44   Get a web page and store in a local file, make the local file get the name
45   of the remote document (if no file name part is specified in the URL, this
46   will fail):
47
48         curl -O http://www.netscape.com/index.html
49
50   Fetch two files and store them with their remote names:
51
52         curl -O www.haxx.se/index.html -O curl.haxx.se/download.html
53
54 USING PASSWORDS
55
56  FTP
57
58    To ftp files using name+passwd, include them in the URL like:
59
60         curl ftp://name:passwd@machine.domain:port/full/path/to/file
61
62    or specify them with the -u flag like
63
64         curl -u name:passwd ftp://machine.domain:port/full/path/to/file
65
66  HTTP
67
68    The HTTP URL doesn't support user and password in the URL string. Curl
69    does support that anyway to provide a ftp-style interface and thus you can
70    pick a file like:
71
72         curl http://name:passwd@machine.domain/full/path/to/file
73
74    or specify user and password separately like in
75
76         curl -u name:passwd http://machine.domain/full/path/to/file
77
78    NOTE! Since HTTP URLs don't support user and password, you can't use that
79    style when using Curl via a proxy. You _must_ use the -u style fetch
80    during such circumstances.
81
82  HTTPS
83
84    Probably most commonly used with private certificates, as explained below.
85
86  GOPHER
87
88    Curl features no password support for gopher.
89
90 PROXY
91
92  Get an ftp file using a proxy named my-proxy that uses port 888:
93
94         curl -x my-proxy:888 ftp://ftp.leachsite.com/README
95
96  Get a file from a HTTP server that requires user and password, using the
97  same proxy as above:
98
99         curl -u user:passwd -x my-proxy:888 http://www.get.this/
100
101  Some proxies require special authentication. Specify by using -U as above:
102
103         curl -U user:passwd -x my-proxy:888 http://www.get.this/
104
105  See also the environment variables Curl support that offer further proxy
106  control.
107
108 RANGES
109
110   With HTTP 1.1 byte-ranges were introduced. Using this, a client can request
111   to get only one or more subparts of a specified document. Curl supports
112   this with the -r flag.
113
114   Get the first 100 bytes of a document:
115
116         curl -r 0-99 http://www.get.this/
117
118   Get the last 500 bytes of a document:
119
120         curl -r -500 http://www.get.this/
121
122   Curl also supports simple ranges for FTP files as well. Then you can only
123   specify start and stop position.
124
125   Get the first 100 bytes of a document using FTP:
126
127         curl -r 0-99 ftp://www.get.this/README  
128
129 UPLOADING
130
131  FTP
132
133   Upload all data on stdin to a specified ftp site:
134
135         curl -T - ftp://ftp.upload.com/myfile
136
137   Upload data from a specified file, login with user and password:
138
139         curl -T uploadfile -u user:passwd ftp://ftp.upload.com/myfile
140
141   Upload a local file to the remote site, and use the local file name remote
142   too:
143  
144         curl -T uploadfile -u user:passwd ftp://ftp.upload.com/
145
146   Upload a local file to get appended to the remote file using ftp:
147
148         curl -T localfile -a ftp://ftp.upload.com/remotefile
149
150   Curl also supports ftp upload through a proxy, but only if the proxy is
151   configured to allow that kind of tunneling. If it does, you can run curl in
152   a fashion similar to:
153
154         curl --proxytunnel -x proxy:port -T localfile ftp.upload.com
155
156  HTTP
157
158   Upload all data on stdin to a specified http site:
159
160         curl -T - http://www.upload.com/myfile
161
162   Note that the http server must've been configured to accept PUT before this
163   can be done successfully.
164
165   For other ways to do http data upload, see the POST section below.
166
167 VERBOSE / DEBUG
168
169   If curl fails where it isn't supposed to, if the servers don't let you
170   in, if you can't understand the responses: use the -v flag to get VERBOSE
171   fetching. Curl will output lots of info and all data it sends and
172   receives in order to let the user see all client-server interaction.
173
174         curl -v ftp://ftp.upload.com/
175
176 DETAILED INFORMATION
177
178   Different protocols provide different ways of getting detailed information
179   about specific files/documents. To get curl to show detailed information
180   about a single file, you should use -I/--head option. It displays all
181   available info on a single file for HTTP and FTP. The HTTP information is a
182   lot more extensive.
183
184   For HTTP, you can get the header information (the same as -I would show)
185   shown before the data by using -i/--include. Curl understands the
186   -D/--dump-header option when getting files from both FTP and HTTP, and it
187   will then store the headers in the specified file.
188
189   Store the HTTP headers in a separate file (headers.txt in the example):
190
191         curl --dump-header headers.txt curl.haxx.se
192
193   Note that headers stored in a separate file can be very useful at a later
194   time if you want curl to use cookies sent by the server. More about that in
195   the cookies section.
196
197 POST (HTTP)
198
199   It's easy to post data using curl. This is done using the -d <data>
200   option.  The post data must be urlencoded.
201
202   Post a simple "name" and "phone" guestbook.
203
204         curl -d "name=Rafael%20Sagula&phone=3320780" \
205                 http://www.where.com/guest.cgi
206
207   How to post a form with curl, lesson #1:
208
209   Dig out all the <input> tags in the form that you want to fill in. (There's
210   a perl program called formfind.pl on the curl site that helps with this).
211
212   If there's a "normal" post, you use -d to post. -d takes a full "post
213   string", which is in the format
214
215         <variable1>=<data1>&<variable2>=<data2>&...
216
217   The 'variable' names are the names set with "name=" in the <input> tags, and
218   the data is the contents you want to fill in for the inputs. The data *must*
219   be properly URL encoded. That means you replace space with + and that you
220   write weird letters with %XX where XX is the hexadecimal representation of
221   the letter's ASCII code.
222
223   Example:
224
225   (page located at http://www.formpost.com/getthis/
226
227         <form action="post.cgi" method="post">
228         <input name=user size=10>
229         <input name=pass type=password size=10>
230         <input name=id type=hidden value="blablabla">
231         <input name=ding value="submit">
232         </form>
233
234   We want to enter user 'foobar' with password '12345'.
235
236   To post to this, you enter a curl command line like:
237
238         curl -d "user=foobar&pass=12345&id=blablabla&dig=submit"  (continues)
239           http://www.formpost.com/getthis/post.cgi
240
241
242   While -d uses the application/x-www-form-urlencoded mime-type, generally
243   understood by CGI's and similar, curl also supports the more capable
244   multipart/form-data type. This latter type supports things like file upload.
245
246   -F accepts parameters like -F "name=contents". If you want the contents to
247   be read from a file, use <@filename> as contents. When specifying a file,
248   you can also specify the file content type by appending ';type=<mime type>'
249   to the file name. You can also post the contents of several files in one
250   field.  For example, the field name 'coolfiles' is used to send three files,
251   with different content types using the following syntax:
252
253         curl -F "coolfiles=@fil1.gif;type=image/gif,fil2.txt,fil3.html" \
254         http://www.post.com/postit.cgi
255
256   If the content-type is not specified, curl will try to guess from the file
257   extension (it only knows a few), or use the previously specified type (from
258   an earlier file if several files are specified in a list) or else it will
259   using the default type 'text/plain'.
260
261   Emulate a fill-in form with -F. Let's say you fill in three fields in a
262   form. One field is a file name which to post, one field is your name and one
263   field is a file description. We want to post the file we have written named
264   "cooltext.txt". To let curl do the posting of this data instead of your
265   favourite browser, you have to read the HTML source of the form page and
266   find the names of the input fields. In our example, the input field names
267   are 'file', 'yourname' and 'filedescription'.
268
269         curl -F "file=@cooltext.txt" -F "yourname=Daniel" \
270              -F "filedescription=Cool text file with cool text inside" \
271              http://www.post.com/postit.cgi
272
273   To send two files in one post you can do it in two ways:
274
275   1. Send multiple files in a single "field" with a single field name:
276  
277         curl -F "pictures=@dog.gif,cat.gif" 
278  
279   2. Send two fields with two field names: 
280
281         curl -F "docpicture=@dog.gif" -F "catpicture=@cat.gif" 
282
283 REFERRER
284
285   A HTTP request has the option to include information about which address
286   that referred to actual page.  Curl allows you to specify the
287   referrer to be used on the command line. It is especially useful to
288   fool or trick stupid servers or CGI scripts that rely on that information
289   being available or contain certain data.
290
291         curl -e www.coolsite.com http://www.showme.com/
292
293   NOTE: The referer field is defined in the HTTP spec to be a full URL.
294
295 USER AGENT
296
297   A HTTP request has the option to include information about the browser
298   that generated the request. Curl allows it to be specified on the command
299   line. It is especially useful to fool or trick stupid servers or CGI
300   scripts that only accept certain browsers.
301
302   Example:
303
304   curl -A 'Mozilla/3.0 (Win95; I)' http://www.nationsbank.com/
305
306   Other common strings:
307     'Mozilla/3.0 (Win95; I)'     Netscape Version 3 for Windows 95
308     'Mozilla/3.04 (Win95; U)'    Netscape Version 3 for Windows 95
309     'Mozilla/2.02 (OS/2; U)'     Netscape Version 2 for OS/2
310     'Mozilla/4.04 [en] (X11; U; AIX 4.2; Nav)'           NS for AIX
311     'Mozilla/4.05 [en] (X11; U; Linux 2.0.32 i586)'      NS for Linux
312
313   Note that Internet Explorer tries hard to be compatible in every way:
314     'Mozilla/4.0 (compatible; MSIE 4.01; Windows 95)'    MSIE for W95
315
316   Mozilla is not the only possible User-Agent name:
317     'Konqueror/1.0'             KDE File Manager desktop client
318     'Lynx/2.7.1 libwww-FM/2.14' Lynx command line browser
319
320 COOKIES
321
322   Cookies are generally used by web servers to keep state information at the
323   client's side. The server sets cookies by sending a response line in the
324   headers that looks like 'Set-Cookie: <data>' where the data part then
325   typically contains a set of NAME=VALUE pairs (separated by semicolons ';'
326   like "NAME1=VALUE1; NAME2=VALUE2;"). The server can also specify for what
327   path the "cookie" should be used for (by specifying "path=value"), when the
328   cookie should expire ("expire=DATE"), for what domain to use it
329   ("domain=NAME") and if it should be used on secure connections only
330   ("secure").
331
332   If you've received a page from a server that contains a header like:
333         Set-Cookie: sessionid=boo123; path="/foo";
334
335   it means the server wants that first pair passed on when we get anything in
336   a path beginning with "/foo".
337
338   Example, get a page that wants my name passed in a cookie:
339
340         curl -b "name=Daniel" www.sillypage.com
341
342   Curl also has the ability to use previously received cookies in following
343   sessions. If you get cookies from a server and store them in a file in a
344   manner similar to:
345
346         curl --dump-header headers www.example.com
347
348   ... you can then in a second connect to that (or another) site, use the
349   cookies from the 'headers' file like:
350
351         curl -b headers www.example.com
352
353   Note that by specifying -b you enable the "cookie awareness" and with -L
354   you can make curl follow a location: (which often is used in combination
355   with cookies). So that if a site sends cookies and a location, you can
356   use a non-existing file to trigger the cookie awareness like:
357
358         curl -L -b empty.txt www.example.com
359
360   The file to read cookies from must be formatted using plain HTTP headers OR
361   as netscape's cookie file. Curl will determine what kind it is based on the
362   file contents.  In the above command, curl will parse the header and store
363   the cookies received from www.example.com.  curl will send to the server the
364   stored cookies which match the request as it follows the location.  The
365   file "empty.txt" may be a non-existant file.
366   
367
368 PROGRESS METER
369
370   The progress meter exists to show a user that something actually is
371   happening. The different fields in the output have the following meaning:
372
373   % Total    % Received % Xferd  Average Speed          Time             Curr.
374                                  Dload  Upload Total    Current  Left    Speed
375   0  151M    0 38608    0     0   9406      0  4:41:43  0:00:04  4:41:39  9287
376
377   From left-to-right:
378    %             - percentage completed of the whole transfer
379    Total         - total size of the whole expected transfer
380    %             - percentage completed of the download
381    Received      - currently downloaded amount of bytes
382    %             - percentage completed of the upload
383    Xferd         - currently uploaded amount of bytes
384    Average Speed
385    Dload         - the average transfer speed of the download
386    Average Speed
387    Upload        - the average transfer speed of the upload
388    Time Total    - expected time to complete the operation
389    Time Current  - time passed since the invoke
390    Time Left     - expected time left to completetion
391    Curr.Speed    - the average transfer speed the last 5 seconds (the first
392                    5 seconds of a transfer is based on less time of course.)
393
394   The -# option will display a totally different progress bar that doesn't
395   need much explanation!
396
397 SPEED LIMIT
398
399   Curl allows the user to set the transfer speed conditions that must be met
400   to let the transfer keep going. By using the switch -y and -Y you
401   can make curl abort transfers if the transfer speed is below the specified
402   lowest limit for a specified time.
403
404   To have curl abort the download if the speed is slower than 3000 bytes per
405   second for 1 minute, run:
406
407         curl -Y 3000 -y 60 www.far-away-site.com
408
409   This can very well be used in combination with the overall time limit, so
410   that the above operatioin must be completed in whole within 30 minutes:
411
412         curl -m 1800 -Y 3000 -y 60 www.far-away-site.com
413
414   Forcing curl not to transfer data faster than a given rate is also possible,
415   which might be useful if you're using a limited bandwidth connection and you
416   don't want your transfer to use all of it.
417
418   Make curl transfer data no faster than 10 kilobytes per second:
419
420         curl --limit-rate 10K www.far-away-site.com
421
422     or
423
424         curl --limit-rate 10240 www.far-away-site.com
425
426   Or prevent curl from uploading data faster than 1 megabyte per second:
427
428         curl -T upload --limit-rate 1M ftp://uploadshereplease.com
429
430 CONFIG FILE
431
432   Curl automatically tries to read the .curlrc file (or _curlrc file on win32
433   systems) from the user's home dir on startup.
434
435   The config file could be made up with normal command line switches, but you
436   can also specify the long options without the dashes to make it more
437   readable. You can separate the options and the parameter with spaces, or
438   with = or :. Comments can be used within the file. If the first letter on a
439   line is a '#'-letter the rest of the line is treated as a comment.
440
441   If you want the parameter to contain spaces, you must inclose the entire
442   parameter within double quotes ("). Within those quotes, you specify a
443   quote as \".
444
445   NOTE: You must specify options and their arguments on the same line.
446
447   Example, set default time out and proxy in a config file:
448
449         # We want a 30 minute timeout:
450         -m 1800
451         # ... and we use a proxy for all accesses:
452         proxy = proxy.our.domain.com:8080
453
454   White spaces ARE significant at the end of lines, but all white spaces
455   leading up to the first characters of each line are ignored.
456
457   Prevent curl from reading the default file by using -q as the first command
458   line parameter, like:
459
460         curl -q www.thatsite.com
461
462   Force curl to get and display a local help page in case it is invoked
463   without URL by making a config file similar to:
464
465         # default url to get
466         url = "http://help.with.curl.com/curlhelp.html"
467
468   You can specify another config file to be read by using the -K/--config
469   flag. If you set config file name to "-" it'll read the config from stdin,
470   which can be handy if you want to hide options from being visible in process
471   tables etc:
472
473         echo "user = user:passwd" | curl -K - http://that.secret.site.com
474
475 EXTRA HEADERS
476
477   When using curl in your own very special programs, you may end up needing
478   to pass on your own custom headers when getting a web page. You can do
479   this by using the -H flag.
480
481   Example, send the header "X-you-and-me: yes" to the server when getting a
482   page:
483
484         curl -H "X-you-and-me: yes" www.love.com
485
486   This can also be useful in case you want curl to send a different text in a
487   header than it normally does. The -H header you specify then replaces the
488   header curl would normally send. If you replace an internal header with an
489   empty one, you prevent that header from being sent. To prevent the Host:
490   header from being used:
491
492         curl -H "Host:" www.server.com
493
494 FTP and PATH NAMES
495
496   Do note that when getting files with the ftp:// URL, the given path is
497   relative the directory you enter. To get the file 'README' from your home
498   directory at your ftp site, do:
499
500         curl ftp://user:passwd@my.site.com/README
501
502   But if you want the README file from the root directory of that very same
503   site, you need to specify the absolute file name:
504
505         curl ftp://user:passwd@my.site.com//README
506
507   (I.e with an extra slash in front of the file name.)
508
509 FTP and firewalls
510
511   The FTP protocol requires one of the involved parties to open a second
512   connction as soon as data is about to get transfered. There are two ways to
513   do this.
514
515   The default way for curl is to issue the PASV command which causes the
516   server to open another port and await another connection performed by the
517   client. This is good if the client is behind a firewall that don't allow
518   incoming connections.
519
520         curl ftp.download.com
521
522   If the server for example, is behind a firewall that don't allow connections
523   on other ports than 21 (or if it just doesn't support the PASV command), the
524   other way to do it is to use the PORT command and instruct the server to
525   connect to the client on the given (as parameters to the PORT command) IP
526   number and port.
527
528   The -P flag to curl supports a few different options. Your machine may have
529   several IP-addresses and/or network interfaces and curl allows you to select
530   which of them to use. Default address can also be used:
531
532         curl -P - ftp.download.com
533
534   Download with PORT but use the IP address of our 'le0' interface (this does
535   not work on windows):
536
537         curl -P le0 ftp.download.com
538
539   Download with PORT but use 192.168.0.10 as our IP address to use:
540
541         curl -P 192.168.0.10 ftp.download.com
542
543 NETWORK INTERFACE
544
545   Get a web page from a server using a specified port for the interface:
546
547         curl --interface eth0:1 http://www.netscape.com/
548
549   or
550
551         curl --interface 192.168.1.10 http://www.netscape.com/
552
553 HTTPS
554
555   Secure HTTP requires SSL libraries to be installed and used when curl is
556   built. If that is done, curl is capable of retrieving and posting documents
557   using the HTTPS procotol.
558
559   Example:
560
561         curl https://www.secure-site.com
562
563   Curl is also capable of using your personal certificates to get/post files
564   from sites that require valid certificates. The only drawback is that the
565   certificate needs to be in PEM-format. PEM is a standard and open format to
566   store certificates with, but it is not used by the most commonly used
567   browsers (Netscape and MSEI both use the so called PKCS#12 format). If you
568   want curl to use the certificates you use with your (favourite) browser, you
569   may need to download/compile a converter that can convert your browser's
570   formatted certificates to PEM formatted ones. This kind of converter is
571   included in recent versions of OpenSSL, and for older versions Dr Stephen
572   N. Henson has written a patch for SSLeay that adds this functionality. You
573   can get his patch (that requires an SSLeay installation) from his site at:
574   http://www.drh-consultancy.demon.co.uk/
575
576   Example on how to automatically retrieve a document using a certificate with
577   a personal password:
578
579         curl -E /path/to/cert.pem:password https://secure.site.com/
580
581   If you neglect to specify the password on the command line, you will be
582   prompted for the correct password before any data can be received.
583
584   Many older SSL-servers have problems with SSLv3 or TLS, that newer versions
585   of OpenSSL etc is using, therefore it is sometimes useful to specify what
586   SSL-version curl should use. Use -3, -2 or -1 to specify that exact SSL
587   version to use (for SSLv3, SSLv2 or TLSv1 respectively):
588
589         curl -2 https://secure.site.com/
590
591   Otherwise, curl will first attempt to use v3 and then v2.
592
593   To use OpenSSL to convert your favourite browser's certificate into a PEM
594   formatted one that curl can use, do something like this (assuming netscape,
595   but IE is likely to work similarly):
596
597     You start with hitting the 'security' menu button in netscape. 
598
599     Select 'certificates->yours' and then pick a certificate in the list 
600
601     Press the 'export' button 
602
603     enter your PIN code for the certs 
604
605     select a proper place to save it 
606
607     Run the 'openssl' application to convert the certificate. If you cd to the
608     openssl installation, you can do it like:
609
610      # ./apps/openssl pkcs12 -in [file you saved] -clcerts -out [PEMfile]
611
612
613 RESUMING FILE TRANSFERS
614
615  To continue a file transfer where it was previously aborted, curl supports
616  resume on http(s) downloads as well as ftp uploads and downloads.
617
618  Continue downloading a document:
619
620         curl -C - -o file ftp://ftp.server.com/path/file
621
622  Continue uploading a document(*1):
623
624         curl -C - -T file ftp://ftp.server.com/path/file
625
626  Continue downloading a document from a web server(*2):
627
628         curl -C - -o file http://www.server.com/
629
630  (*1) = This requires that the ftp server supports the non-standard command
631         SIZE. If it doesn't, curl will say so.
632
633  (*2) = This requires that the web server supports at least HTTP/1.1. If it
634         doesn't, curl will say so.
635
636 TIME CONDITIONS
637
638  HTTP allows a client to specify a time condition for the document it
639  requests. It is If-Modified-Since or If-Unmodified-Since. Curl allow you to
640  specify them with the -z/--time-cond flag.
641
642  For example, you can easily make a download that only gets performed if the
643  remote file is newer than a local copy. It would be made like:
644
645         curl -z local.html http://remote.server.com/remote.html
646
647  Or you can download a file only if the local file is newer than the remote
648  one. Do this by prepending the date string with a '-', as in:
649
650         curl -z -local.html http://remote.server.com/remote.html
651
652  You can specify a "free text" date as condition. Tell curl to only download
653  the file if it was updated since yesterday:
654
655         curl -z yesterday http://remote.server.com/remote.html
656
657  Curl will then accept a wide range of date formats. You always make the date
658  check the other way around by prepending it with a dash '-'.
659
660 DICT
661
662   For fun try
663
664         curl dict://dict.org/m:curl
665         curl dict://dict.org/d:heisenbug:jargon
666         curl dict://dict.org/d:daniel:web1913
667
668   Aliases for 'm' are 'match' and 'find', and aliases for 'd' are 'define'
669   and 'lookup'. For example,
670
671         curl dict://dict.org/find:curl
672
673   Commands that break the URL description of the RFC (but not the DICT
674   protocol) are
675
676         curl dict://dict.org/show:db
677         curl dict://dict.org/show:strat
678
679   Authentication is still missing (but this is not required by the RFC)
680
681 LDAP
682
683   If you have installed the OpenLDAP library, curl can take advantage of it
684   and offer ldap:// support.
685
686   LDAP is a complex thing and writing an LDAP query is not an easy task. I do
687   advice you to dig up the syntax description for that elsewhere. Two places
688   that might suit you are:
689
690   Netscape's "Netscape Directory SDK 3.0 for C Programmer's Guide Chapter 10:
691   Working with LDAP URLs":
692   http://developer.netscape.com/docs/manuals/dirsdk/csdk30/url.htm
693
694   RFC 2255, "The LDAP URL Format" http://www.rfc-editor.org/rfc/rfc2255.txt
695
696   To show you an example, this is now I can get all people from my local LDAP
697   server that has a certain sub-domain in their email address:
698
699         curl -B "ldap://ldap.frontec.se/o=frontec??sub?mail=*sth.frontec.se"
700
701   If I want the same info in HTML format, I can get it by not using the -B
702   (enforce ASCII) flag.
703
704 ENVIRONMENT VARIABLES
705
706   Curl reads and understands the following environment variables:
707
708         http_proxy, HTTPS_PROXY, FTP_PROXY, GOPHER_PROXY
709
710   They should be set for protocol-specific proxies. General proxy should be
711   set with
712         
713         ALL_PROXY
714
715   A comma-separated list of host names that shouldn't go through any proxy is
716   set in (only an asterisk, '*' matches all hosts)
717
718         NO_PROXY
719
720   If a tail substring of the domain-path for a host matches one of these
721   strings, transactions with that node will not be proxied.
722
723
724   The usage of the -x/--proxy flag overrides the environment variables.
725
726 NETRC
727
728   Unix introduced the .netrc concept a long time ago. It is a way for a user
729   to specify name and password for commonly visited ftp sites in a file so
730   that you don't have to type them in each time you visit those sites. You
731   realize this is a big security risk if someone else gets hold of your
732   passwords, so therefor most unix programs won't read this file unless it is
733   only readable by yourself (curl doesn't care though).
734
735   Curl supports .netrc files if told so (using the -n/--netrc and
736   --netrc-optional options). This is not restricted to only ftp,
737   but curl can use it for all protocols where authentication is used.
738
739   A very simple .netrc file could look something like:
740
741         machine curl.haxx.se login iamdaniel password mysecret
742
743 CUSTOM OUTPUT
744
745   To better allow script programmers to get to know about the progress of
746   curl, the -w/--write-out option was introduced. Using this, you can specify
747   what information from the previous transfer you want to extract.
748
749   To display the amount of bytes downloaded together with some text and an
750   ending newline:
751
752         curl -w 'We downloaded %{size_download} bytes\n' www.download.com
753
754 KERBEROS4 FTP TRANSFER
755
756   Curl supports kerberos4 for FTP transfers. You need the kerberos package
757   installed and used at curl build time for it to be used.
758
759   First, get the krb-ticket the normal way, like with the kauth tool. Then use
760   curl in way similar to:
761
762         curl --krb4 private ftp://krb4site.com -u username:fakepwd
763
764   There's no use for a password on the -u switch, but a blank one will make
765   curl ask for one and you already entered the real password to kauth.
766
767 TELNET
768
769   The curl telnet support is basic and very easy to use. Curl passes all data
770   passed to it on stdin to the remote server. Connect to a remote telnet
771   server using a command line similar to:
772
773         curl telnet://remote.server.com
774
775   And enter the data to pass to the server on stdin. The result will be sent
776   to stdout or to the file you specify with -o.
777
778   You might want the -N/--no-buffer option to switch off the buffered output
779   for slow connections or similar.
780
781   Pass options to the telnet protocol negotiation, by using the -t option. To
782   tell the server we use a vt100 terminal, try something like:
783
784         curl -tTTYPE=vt100 telnet://remote.server.com
785
786   Other interesting options for it -t include:
787
788    - XDISPLOC=<X display> Sets the X display location.
789
790    - NEW_ENV=<var,val> Sets an environment variable.
791
792   NOTE: the telnet protocol does not specify any way to login with a specified
793   user and password so curl can't do that automatically. To do that, you need
794   to track when the login prompt is received and send the username and
795   password accordingly.
796
797 PERSISTANT CONNECTIONS
798
799   Specifying multiple files on a single command line will make curl transfer
800   all of them, one after the other in the specified order.
801
802   libcurl will attempt to use persistant connections for the transfers so that
803   the second transfer to the same host can use the same connection that was
804   already initiated and was left open in the previous transfer. This greatly
805   decreases connection time for all but the first transfer and it makes a far
806   better use of the network.
807
808   Note that curl cannot use persistant connections for transfers that are used
809   in subsequence curl invokes. Try to stuff as many URLs as possible on the
810   same command line if they are using the same host, as that'll make the
811   transfers faster. If you use a http proxy for file transfers, practicly
812   all transfers will be persistant.
813
814   Persistant connections were introduced in curl 7.7.
815
816 MAILING LISTS
817
818   For your convenience, we have several open mailing lists to discuss curl,
819   its development and things relevant to this. Get all info at
820   http://curl.haxx.se/mail/. The lists available are:
821
822   curl-users
823
824     Users of the command line tool. How to use it, what doesn't work, new
825     features, related tools, questions, news, installations, compilations,
826     running, porting etc.
827
828   curl-library
829
830     Developers using or developing libcurl. Bugs, extensions, improvements.
831
832   curl-announce
833
834     Low-traffic. Only announcements of new public versions.
835
836   curl-and-PHP
837
838     Using the curl functions in PHP. Everything curl with a PHP angle. Or PHP
839     with a curl angle.
840
841   curl-commits
842
843     Receives notifications on all CVS commits done to the curl source module.
844     This can become quite a large amount of mails during intense development,
845     be aware. This is for us who liks email...
846
847   curl-www-commits
848
849     Receives notifications on all CVS commits done to the curl www module
850     (basicly the web site).  This can become quite a large amount of mails
851     during intense changing, be aware. This is for us who liks email...
852
853   Please direct curl questions, feature requests and trouble reports to one of
854   these mailing lists instead of mailing any individual.