Lines Matching full:curl
4 SPDX-License-Identifier: curl
7 # curl tutorial
13 curl https://www.example.com/
17 curl ftp://ftp.example.com/README
21 curl http://www.example.com:8000/
25 curl ftp://ftp.example.com/
27 Get the all terms matching curl from a dictionary:
29 curl dict://dict.example.com/m:curl
31 Get the definition of curl from a dictionary:
33 curl dict://dict.example.com/d:curl
37 curl ftp://ftp.example.com/ http://www.example.com:8000/
41 curl ftps://files.are.example.com/secrets.txt
45 curl --ftp-ssl ftp://files.are.example.com/secrets.txt
49 curl -u username sftp://example.com/etc/issue
54 curl -u username: --key ~/.ssh/id_rsa scp://example.com/~/file.txt
59 curl -u username: --key ~/.ssh/id_rsa --pass private_key_password
64 curl "http://[2001:1890:1112:1::20]/"
68 curl -u "domain\username:passwd" smb://server.example.com/share/file.txt
74 curl -o thatpage.html http://www.example.com/
79 curl -O http://www.example.com/index.html
83 curl -O www.haxx.se/index.html -O curl.se/download.html
91 curl ftp://name:passwd@ftp.server.example:port/full/path/to/file
95 curl -u name:passwd ftp://ftp.server.example:port/full/path/to/file
112 Typically, curl automatically extracts the public key from the private key
113 file, but in cases where curl does not have the proper library support, a
118 Curl also supports user and password in HTTP URLs, thus you can pick a file
121 curl http://name:passwd@http.server.example/full/path/to/file
125 curl -u name:passwd http://http.server.example/full/path/to/file
127 HTTP offers many different methods of authentication and curl supports
129 method to use, curl defaults to Basic. You can also ask curl to pick the most
134 and password, so that style does not work when using curl via a proxy, even
135 though curl allows it at other times. When using a proxy, you _must_ use the
144 curl supports both HTTP and SOCKS proxy servers, with optional authentication.
152 curl -x my-proxy:888 ftp://ftp.example.com/README
157 curl -u user:passwd -x my-proxy:888 http://www.example.com/
161 curl -U user:passwd -x my-proxy:888 http://www.example.com/
166 curl --noproxy example.com -x my-proxy:888 http://www.example.com/
169 curl uses HTTP/1.0 instead of HTTP/1.1 for any `CONNECT` attempts.
171 curl also supports SOCKS4 and SOCKS5 proxies with `--socks4` and `--socks5`.
173 See also the environment variables Curl supports that offer further proxy
178 curl supports the `-u`, `-Q` and `--ftp-account` options that can be used to
182 curl -u "username@ftp.server.example Proxy-Username:Remote-Pass"
187 transfers, and curl's `-v` option to see exactly what curl is sending.
194 curl -L https://apt.example.org/llvm-snapshot.gpg.key | sudo apt-key add -
202 one or more sub-parts of a specified document. Curl supports this with the
207 curl -r 0-99 http://www.example.com/
211 curl -r -500 http://www.example.com/
213 Curl also supports simple ranges for FTP files as well. Then you can only
218 curl -r 0-99 ftp://www.example.com/README
226 curl -T - ftp://ftp.example.com/myfile
230 curl -T uploadfile -u user:passwd ftp://ftp.example.com/myfile
235 curl -T uploadfile -u user:passwd ftp://ftp.example.com/
239 curl -T localfile -a ftp://ftp.example.com/remotefile
241 Curl also supports ftp upload through a proxy, but only if the proxy is
242 configured to allow that kind of tunneling. If it does, you can run curl in a
245 curl --proxytunnel -x proxy:port -T localfile ftp.example.com
249 curl -T file.txt -u "domain\username:passwd"
256 curl -T - http://www.example.com/myfile
265 If curl fails where it is not supposed to, if the servers do not let you in,
267 fetching. Curl outputs lots of info and what it sends and receives in order to
271 curl -v ftp://ftp.example.com/
273 To get even more details and information on what curl does, try using the
277 curl --trace trace.txt www.haxx.se
283 about specific files/documents. To get curl to show detailed information about
289 shown before the data by using `-i`/`--include`. Curl understands the
295 curl --dump-header headers.txt curl.se
298 you want curl to use cookies sent by the server. More about that in the
303 It is easy to post data using curl. This is done using the `-d <data>` option.
308 curl -d "name=Rafael%20Sagula&phone=3320780" http://www.example.com/guest.cgi
310 Or automatically [URL encode the data](https://everything.curl.dev/http/post/url-encode).
312 curl --data-urlencode "name=Rafael Sagula&phone=3320780" http://www.example.com/guest.cgi
314 How to post a form with curl, lesson #1:
344 To post to this, you would enter a curl command line like:
346 curl -d "user=foobar&pass=12345&id=blablabla&ding=submit" http://example.com/post.cgi
349 understood by CGI's and similar, curl also supports the more capable
359 curl -F "coolfiles=@fil1.gif;type=image/gif,fil2.txt,fil3.html"
362 If the content-type is not specified, curl tries to guess from the file
370 `cooltext.txt`. To let curl do the posting of this data instead of your
375 curl -F "file=@cooltext.txt" -F "yourname=Daniel"
383 curl -F "pictures=@dog.gif,cat.gif" $URL
387 curl -F "docpicture=@dog.gif" -F "catpicture=@cat.gif" $URL
393 allow a user to trick curl into uploading a file.
398 referred it to the actual page. curl allows you to specify the referrer to be
403 curl -e www.example.org http://www.example.com/
408 generated the request. Curl allows it to be specified on the command line. It
414 curl -A 'Mozilla/3.0 (Win95; I)' http://www.bank.example.com/
455 curl -b "name=Daniel" www.example.com
457 Curl also has the ability to use previously received cookies in following
461 curl --dump-header headers www.example.com
466 curl -b headers.txt www.example.com
469 however error-prone and not the preferred way to do this. Instead, make curl
473 curl -c cookies.txt www.example.com
476 can make curl follow a `location:` (which often is used in combination with
480 curl -L -b empty.txt www.example.com
483 Netscape's cookie file. Curl determines what kind it is based on the file
484 contents. In the above command, curl parses the header and store the cookies
485 received from www.example.com. curl sends the stored cookies which match the
492 curl -b cookies.txt -c cookies.txt www.example.com
524 Curl allows the user to set the transfer speed conditions that must be met to
526 curl abort transfers if the transfer speed is below the specified lowest limit
529 To have curl abort the download if the speed is slower than 3000 bytes per
532 curl -Y 3000 -y 60 www.far-away.example.com
537 curl -m 1800 -Y 3000 -y 60 www.far-away.example.com
539 Forcing curl not to transfer data faster than a given rate is also possible,
544 Make curl transfer data no faster than 10 kilobytes per second:
546 curl --limit-rate 10K www.far-away.example.com
550 curl --limit-rate 10240 www.far-away.example.com
552 Or prevent curl from uploading data faster than 1 megabyte per second:
554 curl -T upload --limit-rate 1M ftp://uploads.example.com
563 Curl automatically tries to read the `.curlrc` file (or `_curlrc` file on
588 Prevent curl from reading the default file by using -q as the first command
591 curl -q www.example.org
593 Force curl to get and display a local help page in case it is invoked without
597 url = "http://help.with.curl.example.com/curlhelp.html"
604 echo "user = user:passwd" | curl -K - http://that.secret.example.com
608 When using curl in your own programs, you may end up needing to pass on your
615 curl -H "X-you-and-me: yes" love.example.com
617 This can also be useful in case you want curl to send a different text in a
619 header curl would normally send. If you replace an internal header with an
623 curl -H "Host:" server.example.com
631 curl ftp://user:passwd@my.example.com/README
636 curl ftp://user:passwd@my.example.com//README
646 curl -u $USER sftp://home.example.com/~/.bashrc
654 The default way for curl is to issue the PASV command which causes the server
659 curl ftp.example.com
667 The `-P` flag to curl supports a few different options. Your machine may have
668 several IP-addresses and/or network interfaces and curl allows you to select
671 curl -P - ftp.example.com
676 curl -P le0 ftp.example.com
680 curl -P 192.168.0.10 ftp.example.com
686 curl --interface eth0:1 http://www.example.com/
690 curl --interface 192.168.1.10 http://www.example.com/
694 Secure HTTP requires a TLS library to be installed and used when curl is
695 built. If that is done, curl is capable of retrieving and posting documents
700 curl https://secure.example.com
702 curl is also capable of using client certificates to get/post files from sites
706 you want curl to use the certificates you use with your favorite browser, you
713 curl -E /path/to/cert.pem:password https://secure.example.com/
720 specify what TLS version curl should use.:
722 curl --tlv1.0 https://secure.example.com/
724 Otherwise, curl attempts to use a sensible TLS default version.
728 To continue a file transfer where it was previously aborted, curl supports
733 curl -C - -o file ftp://ftp.example.com/path/file
737 curl -C - -T file ftp://ftp.example.com/path/file
741 curl -C - -o file http://www.example.com/
746 It is `If-Modified-Since` or `If-Unmodified-Since`. curl allows you to specify
752 curl -z local.html http://remote.example.com/remote.html
757 curl -z -local.html http://remote.example.com/remote.html
759 You can specify a plain text date as condition. Tell curl to only download the
762 curl -z "Jan 12 2012" http://remote.example.com/remote.html
764 curl accepts a wide range of date formats. You always make the date check the
771 curl dict://dict.org/m:curl
772 curl dict://dict.org/d:heisenbug:jargon
773 curl dict://dict.org/d:daniel:gcide
778 curl dict://dict.org/find:curl
783 curl dict://dict.org/show:db
784 curl dict://dict.org/show:strat
790 If you have installed the OpenLDAP library, curl can take advantage of it and
791 offer `ldap://` support. On Windows, curl uses WinLDAP from Platform SDK by
794 Default protocol version used by curl is LDAP version 3. Version 2 is used as
800 Format](https://curl.se/rfc/rfc2255.txt)
805 curl -B "ldap://ldap.example.com/o=frontec??sub?mail=*sth.example.com"
809 curl -u user:passwd "ldap://ldap.example.com/o=frontec??sub?mail=*"
810 curl "ldap://user:passwd@ldap.example.com/o=frontec??sub?mail=*"
814 `--basic`, `--ntlm` or `--digest` option in curl command line
816 curl --ntlm "ldap://user:passwd@ldap.example.com/o=frontec??sub?mail=*"
823 Curl reads and understands the following environment variables:
854 by yourself (curl does not care though).
856 Curl supports `.netrc` files if told to (using the `-n`/`--netrc` and
857 `--netrc-optional` options). This is not restricted to just FTP, so curl can
862 machine curl.se login iamdaniel password mysecret
866 To better allow script programmers to get to know about the progress of curl,
873 curl -w 'We downloaded %{size_download} bytes\n' www.example.com
877 Curl supports kerberos4 and kerberos5/GSSAPI for FTP transfers. You need the
878 kerberos package installed and used at curl build time for it to be available.
881 Then use curl in way similar to:
883 curl --krb private ftp://krb4site.example.com -u username:fakepwd
885 There is no use for a password on the `-u` switch, but a blank one makes curl
890 The curl telnet support is basic and easy to use. Curl passes all data passed
894 curl telnet://remote.example.com
905 curl -tTTYPE=vt100 telnet://remote.example.com
913 user and password so curl cannot do that automatically. To do that, you need to
919 Specifying multiple files on a single command line makes curl transfer all of
928 Note that curl cannot use persistent connections for transfers that are used
929 in subsequent curl invokes. Try to stuff as many URLs as possible on the same
945 curl -O http://example.com/file.txt ftp://example.com/moo.exe -o moo.jpg
949 curl -T local1 ftp://example.com/moo.exe -T local2 ftp://example.com/moo2.txt
953 curl connects to a server with IPv6 when a host lookup returns an IPv6 address
960 When this style is used, the `-g` option must be given to stop curl from
974 For your convenience, we have several open mailing lists to discuss curl, its
976 https://curl.se/mail/.
978 Please direct curl questions, feature requests and trouble reports to one of
983 ### `curl-users`
989 ### `curl-library`
993 ### `curl-announce`
999 ### `curl-and-php`
1001 Using the curl functions in PHP. Everything curl with a PHP angle. Or PHP with
1002 a curl angle.
1004 ### `curl-and-python`
1006 Python hackers using curl with or without the python binding pycurl.