7.9.5 commit
[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 CONFIG FILE
415
416   Curl automatically tries to read the .curlrc file (or _curlrc file on win32
417   systems) from the user's home dir on startup.
418
419   The config file could be made up with normal command line switches, but you
420   can also specify the long options without the dashes to make it more
421   readable. You can separate the options and the parameter with spaces, or
422   with = or :. Comments can be used within the file. If the first letter on a
423   line is a '#'-letter the rest of the line is treated as a comment.
424
425   If you want the parameter to contain spaces, you must inclose the entire
426   parameter within double quotes ("). Within those quotes, you specify a
427   quote as \".
428
429   NOTE: You must specify options and their arguments on the same line.
430
431   Example, set default time out and proxy in a config file:
432
433         # We want a 30 minute timeout:
434         -m 1800
435         # ... and we use a proxy for all accesses:
436         proxy = proxy.our.domain.com:8080
437
438   White spaces ARE significant at the end of lines, but all white spaces
439   leading up to the first characters of each line are ignored.
440
441   Prevent curl from reading the default file by using -q as the first command
442   line parameter, like:
443
444         curl -q www.thatsite.com
445
446   Force curl to get and display a local help page in case it is invoked
447   without URL by making a config file similar to:
448
449         # default url to get
450         url = "http://help.with.curl.com/curlhelp.html"
451
452   You can specify another config file to be read by using the -K/--config
453   flag. If you set config file name to "-" it'll read the config from stdin,
454   which can be handy if you want to hide options from being visible in process
455   tables etc:
456
457         echo "user = user:passwd" | curl -K - http://that.secret.site.com
458
459 EXTRA HEADERS
460
461   When using curl in your own very special programs, you may end up needing
462   to pass on your own custom headers when getting a web page. You can do
463   this by using the -H flag.
464
465   Example, send the header "X-you-and-me: yes" to the server when getting a
466   page:
467
468         curl -H "X-you-and-me: yes" www.love.com
469
470   This can also be useful in case you want curl to send a different text in a
471   header than it normally does. The -H header you specify then replaces the
472   header curl would normally send. If you replace an internal header with an
473   empty one, you prevent that header from being sent. To prevent the Host:
474   header from being used:
475
476         curl -H "Host:" www.server.com
477
478 FTP and PATH NAMES
479
480   Do note that when getting files with the ftp:// URL, the given path is
481   relative the directory you enter. To get the file 'README' from your home
482   directory at your ftp site, do:
483
484         curl ftp://user:passwd@my.site.com/README
485
486   But if you want the README file from the root directory of that very same
487   site, you need to specify the absolute file name:
488
489         curl ftp://user:passwd@my.site.com//README
490
491   (I.e with an extra slash in front of the file name.)
492
493 FTP and firewalls
494
495   The FTP protocol requires one of the involved parties to open a second
496   connction as soon as data is about to get transfered. There are two ways to
497   do this.
498
499   The default way for curl is to issue the PASV command which causes the
500   server to open another port and await another connection performed by the
501   client. This is good if the client is behind a firewall that don't allow
502   incoming connections.
503
504         curl ftp.download.com
505
506   If the server for example, is behind a firewall that don't allow connections
507   on other ports than 21 (or if it just doesn't support the PASV command), the
508   other way to do it is to use the PORT command and instruct the server to
509   connect to the client on the given (as parameters to the PORT command) IP
510   number and port.
511
512   The -P flag to curl supports a few different options. Your machine may have
513   several IP-addresses and/or network interfaces and curl allows you to select
514   which of them to use. Default address can also be used:
515
516         curl -P - ftp.download.com
517
518   Download with PORT but use the IP address of our 'le0' interface (this does
519   not work on windows):
520
521         curl -P le0 ftp.download.com
522
523   Download with PORT but use 192.168.0.10 as our IP address to use:
524
525         curl -P 192.168.0.10 ftp.download.com
526
527 NETWORK INTERFACE
528
529   Get a web page from a server using a specified port for the interface:
530
531         curl --interface eth0:1 http://www.netscape.com/
532
533   or
534
535         curl --interface 192.168.1.10 http://www.netscape.com/
536
537 HTTPS
538
539   Secure HTTP requires SSL libraries to be installed and used when curl is
540   built. If that is done, curl is capable of retrieving and posting documents
541   using the HTTPS procotol.
542
543   Example:
544
545         curl https://www.secure-site.com
546
547   Curl is also capable of using your personal certificates to get/post files
548   from sites that require valid certificates. The only drawback is that the
549   certificate needs to be in PEM-format. PEM is a standard and open format to
550   store certificates with, but it is not used by the most commonly used
551   browsers (Netscape and MSEI both use the so called PKCS#12 format). If you
552   want curl to use the certificates you use with your (favourite) browser, you
553   may need to download/compile a converter that can convert your browser's
554   formatted certificates to PEM formatted ones. This kind of converter is
555   included in recent versions of OpenSSL, and for older versions Dr Stephen
556   N. Henson has written a patch for SSLeay that adds this functionality. You
557   can get his patch (that requires an SSLeay installation) from his site at:
558   http://www.drh-consultancy.demon.co.uk/
559
560   Example on how to automatically retrieve a document using a certificate with
561   a personal password:
562
563         curl -E /path/to/cert.pem:password https://secure.site.com/
564
565   If you neglect to specify the password on the command line, you will be
566   prompted for the correct password before any data can be received.
567
568   Many older SSL-servers have problems with SSLv3 or TLS, that newer versions
569   of OpenSSL etc is using, therefore it is sometimes useful to specify what
570   SSL-version curl should use. Use -3 or -2 to specify that exact SSL version
571   to use:
572
573         curl -2 https://secure.site.com/
574
575   Otherwise, curl will first attempt to use v3 and then v2.
576
577   To use OpenSSL to convert your favourite browser's certificate into a PEM
578   formatted one that curl can use, do something like this (assuming netscape,
579   but IE is likely to work similarly):
580
581     You start with hitting the 'security' menu button in netscape. 
582
583     Select 'certificates->yours' and then pick a certificate in the list 
584
585     Press the 'export' button 
586
587     enter your PIN code for the certs 
588
589     select a proper place to save it 
590
591     Run the 'openssl' application to convert the certificate. If you cd to the
592     openssl installation, you can do it like:
593
594      # ./apps/openssl pkcs12 -in [file you saved] -clcerts -out [PEMfile]
595
596
597 RESUMING FILE TRANSFERS
598
599  To continue a file transfer where it was previously aborted, curl supports
600  resume on http(s) downloads as well as ftp uploads and downloads.
601
602  Continue downloading a document:
603
604         curl -C - -o file ftp://ftp.server.com/path/file
605
606  Continue uploading a document(*1):
607
608         curl -C - -T file ftp://ftp.server.com/path/file
609
610  Continue downloading a document from a web server(*2):
611
612         curl -C - -o file http://www.server.com/
613
614  (*1) = This requires that the ftp server supports the non-standard command
615         SIZE. If it doesn't, curl will say so.
616
617  (*2) = This requires that the web server supports at least HTTP/1.1. If it
618         doesn't, curl will say so.
619
620 TIME CONDITIONS
621
622  HTTP allows a client to specify a time condition for the document it
623  requests. It is If-Modified-Since or If-Unmodified-Since. Curl allow you to
624  specify them with the -z/--time-cond flag.
625
626  For example, you can easily make a download that only gets performed if the
627  remote file is newer than a local copy. It would be made like:
628
629         curl -z local.html http://remote.server.com/remote.html
630
631  Or you can download a file only if the local file is newer than the remote
632  one. Do this by prepending the date string with a '-', as in:
633
634         curl -z -local.html http://remote.server.com/remote.html
635
636  You can specify a "free text" date as condition. Tell curl to only download
637  the file if it was updated since yesterday:
638
639         curl -z yesterday http://remote.server.com/remote.html
640
641  Curl will then accept a wide range of date formats. You always make the date
642  check the other way around by prepending it with a dash '-'.
643
644 DICT
645
646   For fun try
647
648         curl dict://dict.org/m:curl
649         curl dict://dict.org/d:heisenbug:jargon
650         curl dict://dict.org/d:daniel:web1913
651
652   Aliases for 'm' are 'match' and 'find', and aliases for 'd' are 'define'
653   and 'lookup'. For example,
654
655         curl dict://dict.org/find:curl
656
657   Commands that break the URL description of the RFC (but not the DICT
658   protocol) are
659
660         curl dict://dict.org/show:db
661         curl dict://dict.org/show:strat
662
663   Authentication is still missing (but this is not required by the RFC)
664
665 LDAP
666
667   If you have installed the OpenLDAP library, curl can take advantage of it
668   and offer ldap:// support.
669
670   LDAP is a complex thing and writing an LDAP query is not an easy task. I do
671   advice you to dig up the syntax description for that elsewhere. Two places
672   that might suit you are:
673
674   Netscape's "Netscape Directory SDK 3.0 for C Programmer's Guide Chapter 10:
675   Working with LDAP URLs":
676   http://developer.netscape.com/docs/manuals/dirsdk/csdk30/url.htm
677
678   RFC 2255, "The LDAP URL Format" http://www.rfc-editor.org/rfc/rfc2255.txt
679
680   To show you an example, this is now I can get all people from my local LDAP
681   server that has a certain sub-domain in their email address:
682
683         curl -B "ldap://ldap.frontec.se/o=frontec??sub?mail=*sth.frontec.se"
684
685   If I want the same info in HTML format, I can get it by not using the -B
686   (enforce ASCII) flag.
687
688 ENVIRONMENT VARIABLES
689
690   Curl reads and understands the following environment variables:
691
692         HTTP_PROXY, HTTPS_PROXY, FTP_PROXY, GOPHER_PROXY
693
694   They should be set for protocol-specific proxies. General proxy should be
695   set with
696         
697         ALL_PROXY
698
699   A comma-separated list of host names that shouldn't go through any proxy is
700   set in (only an asterisk, '*' matches all hosts)
701
702         NO_PROXY
703
704   If a tail substring of the domain-path for a host matches one of these
705   strings, transactions with that node will not be proxied.
706
707
708   The usage of the -x/--proxy flag overrides the environment variables.
709
710 NETRC
711
712   Unix introduced the .netrc concept a long time ago. It is a way for a user
713   to specify name and password for commonly visited ftp sites in a file so
714   that you don't have to type them in each time you visit those sites. You
715   realize this is a big security risk if someone else gets hold of your
716   passwords, so therefor most unix programs won't read this file unless it is
717   only readable by yourself (curl doesn't care though).
718
719   Curl supports .netrc files if told so (using the -n/--netrc option). This is
720   not restricted to only ftp, but curl can use it for all protocols where
721   authentication is used.
722
723   A very simple .netrc file could look something like:
724
725         machine curl.haxx.se login iamdaniel password mysecret
726
727 CUSTOM OUTPUT
728
729   To better allow script programmers to get to know about the progress of
730   curl, the -w/--write-out option was introduced. Using this, you can specify
731   what information from the previous transfer you want to extract.
732
733   To display the amount of bytes downloaded together with some text and an
734   ending newline:
735
736         curl -w 'We downloaded %{size_download} bytes\n' www.download.com
737
738 KERBEROS4 FTP TRANSFER
739
740   Curl supports kerberos4 for FTP transfers. You need the kerberos package
741   installed and used at curl build time for it to be used.
742
743   First, get the krb-ticket the normal way, like with the kauth tool. Then use
744   curl in way similar to:
745
746         curl --krb4 private ftp://krb4site.com -u username:fakepwd
747
748   There's no use for a password on the -u switch, but a blank one will make
749   curl ask for one and you already entered the real password to kauth.
750
751 TELNET
752
753   The curl telnet support is basic and very easy to use. Curl passes all data
754   passed to it on stdin to the remote server. Connect to a remote telnet
755   server using a command line similar to:
756
757         curl telnet://remote.server.com
758
759   And enter the data to pass to the server on stdin. The result will be sent
760   to stdout or to the file you specify with -o.
761
762   You might want the -N/--no-buffer option to switch off the buffered output
763   for slow connections or similar.
764
765   Pass options to the telnet protocol negotiation, by using the -t option. To
766   tell the server we use a vt100 terminal, try something like:
767
768         curl -tTTYPE=vt100 telnet://remote.server.com
769
770   Other interesting options for it -t include:
771
772    - XDISPLOC=<X display> Sets the X display location.
773
774    - NEW_ENV=<var,val> Sets an environment variable.
775
776   NOTE: the telnet protocol does not specify any way to login with a specified
777   user and password so curl can't do that automatically. To do that, you need
778   to track when the login prompt is received and send the username and
779   password accordingly.
780
781 PERSISTANT CONNECTIONS
782
783   Specifying multiple files on a single command line will make curl transfer
784   all of them, one after the other in the specified order.
785
786   libcurl will attempt to use persistant connections for the transfers so that
787   the second transfer to the same host can use the same connection that was
788   already initiated and was left open in the previous transfer. This greatly
789   decreases connection time for all but the first transfer and it makes a far
790   better use of the network.
791
792   Note that curl cannot use persistant connections for transfers that are used
793   in subsequence curl invokes. Try to stuff as many URLs as possible on the
794   same command line if they are using the same host, as that'll make the
795   transfers faster. If you use a http proxy for file transfers, practicly
796   all transfers will be persistant.
797
798   Persistant connections were introduced in curl 7.7.
799
800 MAILING LISTS
801
802   For your convenience, we have several open mailing lists to discuss curl,
803   its development and things relevant to this.
804
805   To subscribe to the main curl list, mail curl-request@contactor.se with
806   "subscribe <fill in your email address>" in the body.
807
808   To subscribe to the curl-library users/deverlopers list, follow the
809   instructions at http://curl.haxx.se/mail/
810
811   To subscribe to the curl-announce list, to only get information about new
812   releases, follow the instructions at http://curl.haxx.se/mail/
813
814   To subscribe to the curl-and-PHP list in which curl using with PHP is
815   discussed, follow the instructions at http://curl.haxx.se/mail/
816
817   Please direct curl questions, feature requests and trouble reports to one of
818   these mailing lists instead of mailing any individual.