/opt/alt/curlssl11/usr/share/man/man1
Edit: /opt/alt/curlssl11/usr/share/man/man1/curl.1 (276368B)
.\" **************************************************************************
.\" * _ _ ____ _
.\" * Project ___| | | | _ \| |
.\" * / __| | | | |_) | |
.\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____|
.\" *
.\" * Copyright (C) Daniel Stenberg,
, et al.
.\" *
.\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms
.\" * are also available at https://curl.se/docs/copyright.html.
.\" *
.\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
.\" * copies of the Software, and permit persons to whom the Software is
.\" * furnished to do so, under the terms of the COPYING file.
.\" *
.\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
.\" * KIND, either express or implied.
.\" *
.\" * SPDX-License-Identifier: curl
.\" *
.\" **************************************************************************
.\"
.\" DO NOT EDIT. Generated by the curl project managen man page generator.
.\"
.TH curl 1 "2026-08-12" "curl 8.21.0" "curl Manual"
.SH NAME
curl \- transfer a URL
.SH SYNOPSIS
\fBcurl [options / URLs]\fP
.SH DESCRIPTION
\fBcurl\fP is a tool for transferring data from or to a server using URLs. It
supports these protocols: DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS,
IMAP, IMAPS, LDAP, LDAPS, MQTT, MQTTS, POP3, POP3S, RTSP, SCP, SFTP, SMB,
SMBS, SMTP, SMTPS, TELNET, TFTP, WS and WSS.
curl is powered by libcurl for all transfer\-related features. See
\fIlibcurl(3)\fP for details.
.SH URL
The URL syntax is protocol\-dependent. You can find a detailed description in
RFC 3986.
If you provide a URL without a leading "protocol://" scheme, curl guesses
what protocol you want. It then defaults to HTTP but assumes others based on
often\-used hostname prefixes. For example, for hostnames starting with "ftp."
curl assumes you want FTP.
You can specify any amount of URLs on the command line. They are fetched in a
sequential manner in the specified order unless you use \fI\-\-parallel\fP. You can
specify command line options and URLs mixed and in any order on the command
line.
curl attempts to reuse connections when doing multiple transfers, so that
getting many files from the same server do not use multiple connects and setup
handshakes. This improves speed. Connection reuse can only be done for URLs
specified for a single command line invocation and cannot be performed between
separate curl runs.
Everything provided on the command line that is not a command line option or
its argument, curl assumes is a URL and treats it as such.
.SH GLOBBING
You can specify multiple URLs or parts of URLs by writing lists within braces
or ranges within brackets. We call this "globbing".
Provide a list with three different names like this:
.nf
https://fun.example/{one,two,three}.jpg
sftp://{one,two,three}.example/README
.fi
Do sequences of alphanumeric series by using [] as in:
.nf
ftp://ftp.example.com/file[1\-100].txt
.fi
With leading zeroes:
.nf
ftp://ftp.example.com/file[001\-100].txt
.fi
With letters through the alphabet:
.nf
ftp://ftp.example.com/file[a\-z].txt
.fi
Nested sequences are not supported, but you can use several ones next to each
other:
.nf
https://example.com/archive[1996\-1999]/vol[1\-4]/part{a,b,c}.html
.fi
You can specify a step counter for the ranges to get every Nth number or
letter:
.nf
https://example.com/file[1\-100:10].txt
https://example.com/file[a\-z:2].txt
.fi
When using [] or {} sequences when invoked from a command line prompt, you
probably have to put the full URL within double quotes to avoid the shell from
interfering with it. This also goes for other characters treated special, like
for example \(aq&\(aq, \(aq?\(aq and \(aq*\(aq.
The separate globbing components can be referenced in the \fI\-\-output\fP option to
allow pieces to be reused in the target filename.
Starting in curl 8.21.0, the separate globbing parts can be named and
referenced by their names. The case sensitive alphanumeric name is set
enclosed within angle brackets after the opening character. Examples:
.nf
https://fun.example/{one,two,three}.jpg
ftp://ftp.example.com/file[1\-100].txt
.fi
Setting the same glob name twice is an error.
Switch off globbing with \fI\-\-globoff\fP.
.SH VARIABLES
curl supports command line variables (added in 8.3.0). Set variables with
\fI\-\-variable\fP name=content or \fI\-\-variable\fP name@file (where "file" can be stdin if
set to a single dash (\-)).
Variable contents can be expanded in option parameters using "{{name}}" if the
option name is prefixed with "\fI\-\-expand\-\fP". This gets the contents of the
variable "name" inserted, or a blank if the name does not exist as a
variable. Insert "{{" verbatim in the string by prefixing it with a backslash,
like "\\{{".
You can access and expand environment variables by importing them with
\&"\fI\-\-variable\fP %name". This imports the variable called "name" but exits with an
error if that environment variable is not already set. To provide a default
value in case it is not already set, use "\fI\-\-variable\fP %name=content" or
\&"\fI\-\-variable\fP %name@content".
Example: get the USER environment variable and expand into the URL, fail if
USER is not set:
.nf
-\-variable \(aq%USER\(aq
-\-expand\-url = "https://example.com/api/{{USER}}/method"
.fi
When expanding variables, curl supports a set of functions that can make the
variable contents more convenient to use. It can trim leading and trailing
white space with "trim", output the contents as a JSON quoted string with
\&"json", URL encode the string with "url", base64 encode it with "b64" and
base64 decode it with "64dec". To apply functions to a variable expansion, add
them colon separated to the right side of the variable. Variable content
holding null bytes that are not encoded when expanded causes an error.
Example: get the contents of a file called $HOME/.secret into a variable
called "fix". Make sure that the content is trimmed and percent\-encoded when
sent as POST data:
.nf
-\-variable %HOME
-\-expand\-variable fix@{{HOME}}/.secret
-\-expand\-data "{{fix:trim:url}}"
https://example.com/
.fi
Command line variables and expansions were added in 8.3.0.
.SH OUTPUT
If not told otherwise, curl writes the received data to stdout. It can be
instructed to instead save that data into a local file, using the \fI\-\-output\fP or
\fI\-\-remote\-name\fP options. If curl is given multiple URLs to transfer on the
command line, it similarly needs multiple options for where to save them.
curl does not parse or otherwise "understand" the content it gets or writes as
output. It does no encoding or decoding, unless explicitly asked to with
dedicated command line options.
.SH PROTOCOLS
curl supports numerous protocols, or put in URL terms: schemes. Your
particular build may not support them all.
.IP DICT
Lets you lookup words using online dictionaries.
.IP FILE
Read or write local files. curl does not support accessing "file://" URL
remotely, but when running on Microsoft Windows using the native UNC approach
works. Only absolute paths.
.IP FTP(S)
curl supports the File Transfer Protocol with a lot of tweaks and levers. With
or without using TLS.
.IP GOPHER(S)
Retrieve files.
.IP HTTP(S)
curl supports HTTP with numerous options and variations. It can speak HTTP
version 0.9, 1.0, 1.1, 2 and 3 depending on build options and the correct
command line options.
.IP IMAP(S)
Using the mail reading protocol, curl can download emails for you. With or
without using TLS.
.IP LDAP(S)
curl can do directory lookups for you, with or without TLS.
.IP MQTT
curl supports MQTT version 3. Downloading over MQTT equals subscribing to a
topic while uploading/posting equals publishing on a topic. MQTT over TLS is not
supported (yet).
.IP POP3(S)
Downloading from a pop3 server means getting an email. With or without using
TLS.
.IP RTSP
curl supports RTSP 1.0 downloads.
.IP SCP
curl supports SSH version 2 scp transfers.
.IP SFTP
curl supports SFTP (draft 5) done over SSH version 2.
.IP SMB(S)
curl supports SMB version 1 for upload and download.
.IP SMTP(S)
Uploading contents to an SMTP server means sending an email. With or without
TLS.
.IP TELNET
Fetching a telnet URL starts an interactive session where it sends what it
reads on stdin and outputs what the server sends it.
.IP TFTP
curl can do TFTP downloads and uploads.
.IP WS(S)
WebSocket done over HTTP/1. WSS implies that it works over HTTPS.
.SH PROGRESS METER
curl normally displays a progress meter during operations, indicating the
amount of transferred data, transfer speeds and estimated time left, etc. The
progress meter displays the transfer rate in bytes per second. The used
suffixes ("k" for kilo, "M" for mega, "G" for giga, "T" for tera, "P" for peta
and "E" for exa) are 1024 based. For example 1k is 1024 bytes. 1M is 1048576
bytes. Strictly speaking this makes the units kibibyte and mebibyte etc.
curl displays this data to the terminal by default, so if you invoke curl to
do an operation and it is about to write data to the terminal, it \fIdisables\fP
the progress meter as otherwise it would mess up the output mixing progress
meter and response data.
If you want a progress meter for HTTP POST or PUT requests, you need to
redirect the response output to a file, using shell redirect (>), \fI\-\-output\fP or
similar.
This does not apply to FTP upload as that operation does not spit out any
response data to the terminal.
If you prefer a progress bar instead of the regular meter, \fI\-\-progress\-bar\fP is
your friend. You can also disable the progress meter completely with the
\fI\-\-silent\fP option.
.SH VERSION
This man page describes curl 8.21.0. If you use a later version, chances
are this man page does not fully document it. If you use an earlier version,
this document tries to include version information about which specific
version that introduced changes.
You can always learn which the latest curl version is by running
.nf
curl https://curl.se/info
.fi
The online version of this man page is always showing the latest incarnation:
https://curl.se/docs/manpage.html
.SH OPTIONS
Options start with one or two dashes. Many of the options require an
additional value next to them. If provided text does not start with a dash, it
is presumed to be and treated as a URL.
The short "single\-dash" form of the options, \-d for example, may be used with
or without a space between it and its value, although a space is a recommended
separator. The long double\-dash form, \fI\-\-data\fP for example, requires a space
between it and its value.
Short version options that do not need any additional values can be used
immediately next to each other, like for example you can specify all the
options \fI\-O\fP, \fI\-L\fP and \fI\-v\fP at once as \fI\-OLv\fP.
In general, all boolean options are enabled with \--\fBoption\fP and yet again
disabled with \--\fBno\-\fPoption. That is, you use the same option name but
prefix it with "no\-". In this list we mostly show the \--\fBoption\fP version of
them.
When \fI\-\-next\fP is used, it resets the parser state and you start again with a
clean option state, except for the options that are global. Global options
retain their values and meaning even after \fI\-\-next\fP.
If the long option name ends with an equals sign ("="), the argument is the
text following on its right side. (Added in 8.16.0)
The first argument that is exactly two dashes ("\--"), marks the end of
options; any argument after the end of options is interpreted as a URL
argument even if it starts with a dash.
curl does little to no verification of the contents of command line arguments.
Passing in "creative octets" like newlines might trigger unexpected results.
The following options are global: \fI\-\-fail\-early\fP, \fI\-\-libcurl\fP, \fI\-\-parallel\-immediate\fP, \fI\-\-parallel\-max\-host\fP, \fI\-\-parallel\-max\fP, \fI\-\-parallel\fP, \fI\-\-progress\-bar\fP, \fI\-\-rate\fP, \fI\-\-show\-error\fP, \fI\-\-stderr\fP, \fI\-\-styled\-output\fP, \fI\-\-trace\-ascii\fP, \fI\-\-trace\-config\fP, \fI\-\-trace\-ids\fP, \fI\-\-trace\-time\fP, \fI\-\-trace\fP and \fI\-\-verbose\fP.
.SH ALL OPTIONS
.IP "\-\-abstract\-unix\-socket "
(HTTP) Connect to the server through an abstract Unix domain socket, instead of using
the network. Note: netstat shows the path of an abstract socket prefixed with
\&"@", however the argument should not have this leading character.
If \fI\-\-abstract\-unix\-socket\fP is provided several times, the last set value is used.
Example:
.nf
curl --abstract-unix-socket socketpath https://example.com
.fi
See also \fI\-\-unix\-socket\fP.
.IP "\-\-alt\-svc "
(HTTPS) Enable the alt\-svc parser. If the filename points to an existing alt\-svc cache
file, that gets used. After a completed transfer, the cache is saved to the
filename again if it has been modified.
Specify a "" filename (zero length) to avoid loading/saving and make curl
handle the cache in memory.
You may want to restrict your umask to prevent other users on the same system
to access the created file.
If this option is used several times, curl loads contents from all the
files but the last one is used for saving.
\fI\-\-alt\-svc\fP can be used several times in a command line.
Example:
.nf
curl --alt-svc svc.txt https://example.com
.fi
See also \fI\-\-resolve\fP and \fI\-\-connect\-to\fP.
.IP "\-\-anyauth"
(HTTP) Figure out authentication method automatically, and use the most secure one
the remote site claims to support. This is done by first doing a request and
checking the response\-headers, thus possibly inducing an extra network
round\-trip. This option is used instead of setting a specific authentication
method, which you can do with \fI\-\-basic\fP, \fI\-\-digest\fP, \fI\-\-ntlm\fP, and \fI\-\-negotiate\fP.
Using \fI\-\-anyauth\fP is not recommended if you do uploads from stdin, since it may
require data to be sent twice and then the client must be able to rewind. If
the need should arise when uploading from stdin, the upload operation fails.
Used together with \fI\-\-user\fP.
Example:
.nf
curl --anyauth --user me:pwd https://example.com
.fi
See also \fI\-\-proxy\-anyauth\fP, \fI\-\-basic\fP and \fI\-\-digest\fP.
.IP "\-a, \-\-append"
(FTP SFTP) When used in an upload, this option makes curl append to the target file
instead of overwriting it. If the remote file does not exist, it is
created. Note that this flag is ignored by some SFTP servers (including
OpenSSH).
Providing \fI\-\-append\fP multiple times has no extra effect.
Disable it again with \-\-no-append.
Example:
.nf
curl --upload-file local --append ftp://example.com/
.fi
See also \fI\-\-range\fP and \fI\-\-continue\-at\fP.
.IP "\-\-aws\-sigv4 "
(HTTP) Use AWS V4 signature authentication in the transfer.
The provider argument is a string that is used by the algorithm when creating
outgoing authentication headers.
The region argument is a string that points to a geographic area of
a resources collection (region\-code) when the region name is omitted from
the endpoint.
The service argument is a string that points to a function provided by a cloud
(service\-code) when the service name is omitted from the endpoint.
If \fI\-\-aws\-sigv4\fP is provided several times, the last set value is used.
Example:
.nf
curl --aws-sigv4 "aws:amz:us-east-2:es" --user "key:secret" https://example.com
.fi
Added in 7.75.0. See also \fI\-\-basic\fP and \fI\-\-user\fP.
.IP "\-\-basic"
(HTTP) Use HTTP Basic authentication with the remote host. This method is the default
and this option is usually pointless, unless you use it to override a
previously set option that sets a different authentication method (such as
\fI\-\-ntlm\fP, \fI\-\-digest\fP, or \fI\-\-negotiate\fP).
Used together with \fI\-\-user\fP.
Providing \fI\-\-basic\fP multiple times has no extra effect.
Disable it again with \-\-no-basic.
Example:
.nf
curl -u name:password --basic https://example.com
.fi
See also \fI\-\-proxy\-basic\fP.
.IP "\-\-ca\-native"
(TLS) Use the operating system\(aqs native CA store for certificate verification.
This option is independent of other CA certificate locations set at run time or
build time. Those locations are searched in addition to the native CA store.
This option works with OpenSSL and its forks (BoringSSL, LibreSSL, etc) on
Windows (Added in 7.71.0) and on Apple OS when libcurl is built with
Apple SecTrust enabled. (Added in 8.17.0)
This option works with wolfSSL on Windows, Linux (Debian, Ubuntu, Gentoo,
Fedora, RHEL), macOS, Android and iOS. (Added in 8.3.0)
This option works with GnuTLS (Added in 8.5.0) and also uses Apple
SecTrust when libcurl is built with it. (Added in 8.17.0)
This option works with Rustls on Windows, macOS, Android and iOS. On Linux it
is equivalent to using the Mozilla CA certificate bundle. When used with Rustls
_only_ the native CA store is consulted, not other locations set at run time or
build time. (Added in 8.13.0)
This option currently has no effect for Schannel. This is the native TLS
library from Microsoft, that by default uses the native CA store for
verification unless overridden by a CA certificate location setting.
Providing \fI\-\-ca\-native\fP multiple times has no extra effect.
Disable it again with \-\-no-ca-native.
Example:
.nf
curl --ca-native https://example.com
.fi
Added in 8.2.0. See also \fI\-\-cacert\fP, \fI\-\-capath\fP, \fI\-\-dump\-ca\-embed\fP, \fI\-\-insecure\fP and \fI\-\-proxy\-ca\-native\fP.
.IP "\-\-cacert "
(TLS) Use the specified certificate file to verify the peer. The file may contain
multiple CA certificates. The certificate(s) must be in PEM format. Normally
curl is built to use a default file for this, so this option is typically used
to alter that default file.
curl recognizes the environment variable named \(aqCURL_CA_BUNDLE\(aq if it is set
and the TLS backend is not Schannel, and uses the given path as a path to a CA
cert bundle. This option overrides that variable.
(Windows) curl automatically looks for a CA certs file named
\(aqcurl\-ca\-bundle.crt\(aq, either in the same directory as curl.exe, or in the
Current Working Directory, or in any folder along your PATH.
curl 8.11.0 added a build\-time option to disable this search behavior, and
another option to restrict search to the application\(aqs directory.
(Schannel) This option is supported for Schannel in Windows 7 or later (added
in 7.60.0). This option is supported for backward compatibility with other SSL
engines; instead it is recommended to use Windows\(aq store of root certificates
(the default for Schannel).
If \fI\-\-cacert\fP is provided several times, the last set value is used.
Example:
.nf
curl --cacert CA-file.txt https://example.com
.fi
See also \fI\-\-capath\fP, \fI\-\-dump\-ca\-embed\fP and \fI\-\-insecure\fP.
.IP "\-\-capath "
(TLS) Use the specified certificate directory to verify the peer. If curl is built against
OpenSSL, multiple paths can be provided by separating them with the appropriate platform\-specific
separator (e.g. "path1:path2:path3" on Unix\-style platforms for "path1;path2;path3" on Windows).
The certificates must be in PEM format, and if curl is built against OpenSSL, the
directory must have been processed using the c_rehash utility supplied with
OpenSSL. Using \fI\-\-capath\fP can allow OpenSSL\-powered curl to make SSL\-connections
much more efficiently than using \fI\-\-cacert\fP if the \fI\-\-cacert\fP file contains many
CA certificates.
If this option is set, the default capath value is ignored.
If \fI\-\-capath\fP is provided several times, the last set value is used.
Example:
.nf
curl --capath /local/directory https://example.com
.fi
See also \fI\-\-cacert\fP, \fI\-\-dump\-ca\-embed\fP and \fI\-\-insecure\fP.
.IP "\-E, \-\-cert "
(TLS) Use the specified client certificate file when getting a file with HTTPS, FTPS
or another SSL\-based protocol. The certificate must be PEM format. If the
optional password is not specified, it is queried for on the terminal. Note
that this option assumes a certificate file that is the private key and the
client certificate concatenated. See \fI\-\-cert\fP and \fI\-\-key\fP to specify them
independently.
In the portion of the argument, you must escape the character
\&":" as "\\:" so that it is not recognized as the password delimiter. Similarly,
you must escape the double quote character as \\" so that it is not recognized
as an escape character.
If curl is built against OpenSSL, and the engine pkcs11 or pkcs11
provider is available, then a PKCS#11 URI (RFC 7512) can be used to specify a
certificate located in a PKCS#11 device. A string beginning with "pkcs11:" is
interpreted as a PKCS#11 URI. If a PKCS#11 URI is provided, then the \fI\-\-engine\fP
option is set as "pkcs11" if none was provided and the \fI\-\-cert\-type\fP option is
set as "ENG" or "PROV" if none was provided (depending on OpenSSL version).
If curl is built against GnuTLS, a PKCS#11 URI can be used to specify
a certificate located in a PKCS#11 device. A string beginning with "pkcs11:"
is interpreted as a PKCS#11 URI.
(Schannel) Client certificates must be specified by a path expression to a
certificate store. (Loading \fIPFX\fP is not supported; you can import it to a
store first). You can use "\\\\"
to refer to a certificate in the system certificates store, for example,
\fI"CurrentUser\\MY\\934a7ac6f8a5d579285a74fa61e19f23ddfe8d7a"\fP. Thumbprint is
usually a SHA\-1 hex string which you can see in certificate details. Following
store locations are supported: \fICurrentUser\fP, \fILocalMachine\fP,
\fICurrentService\fP, \fIServices\fP, \fICurrentUserGroupPolicy\fP,
\fILocalMachineGroupPolicy\fP and \fILocalMachineEnterprise\fP.
If \fI\-\-cert\fP is provided several times, the last set value is used.
Example:
.nf
curl --cert certfile --key keyfile https://example.com
.fi
See also \fI\-\-cert\-type\fP, \fI\-\-key\fP and \fI\-\-key\-type\fP.
.IP "\-\-cert\-status"
(TLS) Verify the status of the server certificate by using the Certificate Status
Request (aka. OCSP stapling) TLS extension.
If this option is enabled and the server sends an invalid (e.g. expired)
response, if the response suggests that the server certificate has been
revoked, or no response at all is received, the verification fails.
This support is currently only implemented in the OpenSSL and GnuTLS backends.
Providing \fI\-\-cert\-status\fP multiple times has no extra effect.
Disable it again with \-\-no-cert-status.
Example:
.nf
curl --cert-status https://example.com
.fi
See also \fI\-\-pinnedpubkey\fP.
.IP "\-\-cert\-type "
(TLS) Set type of the provided client certificate. PEM, DER, ENG, PROV and P12 are
recognized types.
The default type depends on the TLS backend and is usually PEM. For Schannel
it is P12. If \fI\-\-cert\fP is a pkcs11: URI then ENG or PROV is the default type
(depending on OpenSSL version).
If \fI\-\-cert\-type\fP is provided several times, the last set value is used.
Example:
.nf
curl --cert-type PEM --cert file https://example.com
.fi
See also \fI\-\-cert\fP, \fI\-\-key\fP and \fI\-\-key\-type\fP.
.IP "\-\-ciphers "
(TLS) Specify which cipher suites to use in the connection if it negotiates TLS 1.2
(1.1, 1.0). The list of ciphers suites must specify valid ciphers. Read up on
cipher suite details on this URL:
https://curl.se/docs/ssl\-ciphers.html
If \fI\-\-ciphers\fP is provided several times, the last set value is used.
Example:
.nf
curl --ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256 https://example.com
.fi
See also \fI\-\-tls13\-ciphers\fP, \fI\-\-proxy\-ciphers\fP and \fI\-\-curves\fP.
.IP "\-\-compressed"
(HTTP) Request a compressed response using one of the algorithms curl supports, and
automatically decompress the content.
Response headers are not modified when saved, so if they are "interpreted"
separately again at a later point they might appear to be saying that the
content is (still) compressed; while in fact it has already been decompressed.
If this option is used and the server sends an unsupported encoding, curl
reports an error. This is a request, not an order; the server may or may not
deliver data compressed.
\fBWARNING\fP: when decompressing data, even tiny transfers might be expanded
and generate a huge amount of bytes. You might want to limit using this option
to only known and trusted sites using secure protocols, perhaps in combination
with \fI\-\-max\-filesize\fP.
Providing \fI\-\-compressed\fP multiple times has no extra effect.
Disable it again with \-\-no-compressed.
Example:
.nf
curl --compressed https://example.com
.fi
See also \fI\-\-compressed\-ssh\fP.
.IP "\-\-compressed\-ssh"
(SCP SFTP) Enable SSH compression. This is a request, not an order; the server may or may
not do it. This allows the data to be sent compressed over the wire, and
automatically decompressed in the receiving end, to save bandwidth.
Providing \fI\-\-compressed\-ssh\fP multiple times has no extra effect.
Disable it again with \-\-no-compressed-ssh.
Example:
.nf
curl --compressed-ssh sftp://example.com/
.fi
See also \fI\-\-compressed\fP.
.IP "\-K, \-\-config "
Specify a text file to read curl arguments from. The command line arguments
found in the text file are used as if they were provided on the command
line.
Options and their parameters must be specified on the same line in the file,
separated by whitespace, colon, or the equals sign. Long option names can
optionally be given in the config file without the initial double dashes and
if so, the colon or equals characters can be used as separators. If the option
is specified with one or two dashes, there can be no colon or equals character
between the option and its parameter.
If the parameter contains whitespace or starts with a colon (:) or equals sign
(=), it must be specified enclosed within double quotes ("like this"). Within
double quotes the following escape sequences are available: \\\\, \\", \\t, \\n, \\r
and \\v. A backslash preceding any other letter is ignored.
If the first non\-blank column of a config line is a \(aq#\(aq character, that line
is treated as a comment.
Only write one option per physical line in the config file. A single line is
required to be no more than 10 megabytes (since 8.2.0).
Specify the filename to \fI\-\-config\fP as minus "\-" to make curl read the file from
stdin.
Note that to be able to specify a URL in the config file, you need to specify
it using the \fI\-\-url\fP option, and not by writing the URL on its own line.
It could look similar to this:
.nf
url = "https://curl.se/docs/"
# \--\- Example file \--\-
# this is a comment
url = "example.com"
output = "curlhere.html"
user\-agent = "superagent/1.0"
# and fetch another URL too
url = "example.com/docs/manpage.html"
-O
referer = "http://nowhereatall.example.com/"
# \--\- End of example file \--\-
.fi
When curl is invoked, it (unless \fI\-\-disable\fP is used) checks for a default
config file and uses it if found, even when \fI\-\-config\fP is used. The default
config file is checked for in the following places in this order:
1) \fB"$CURL_HOME/.curlrc"\fP
2) \fB"$XDG_CONFIG_HOME/curlrc"\fP (Added in 7.73.0)
3) \fB"$HOME/.curlrc"\fP
4) Windows: \fB"%USERPROFILE%\\.curlrc"\fP
5) Windows: \fB"%APPDATA%\\.curlrc"\fP
6) Windows: \fB"%USERPROFILE%\\Application Data\\.curlrc"\fP
7) Non\-Windows: use getpwuid to find the home directory
8) On Windows, if it finds no \fI.curlrc\fP file in the sequence described above, it
checks for one in the same directory the curl executable is placed.
On Windows two filenames are checked per location: \fI.curlrc\fP and \fI_curlrc\fP,
preferring the former. Older versions on Windows checked for \fI_curlrc\fP only.
\fI\-\-config\fP can be used several times in a command line.
Example:
.nf
curl --config file.txt https://example.com
.fi
See also \fI\-\-disable\fP.
.IP "\-\-connect\-timeout "
Maximum time in seconds that you allow curl\(aqs connection to take. This only
limits the connection phase, so if curl connects within the given period it
continues \- if not it exits.
This option accepts decimal values. The decimal value needs
to be provided using a dot (.) as decimal separator \- not the local version
even if it might be using another separator.
The connection phase is considered complete when the DNS lookup and requested
TCP, TLS or QUIC handshakes are done.
If \fI\-\-connect\-timeout\fP is provided several times, the last set value is used.
Examples:
.nf
curl --connect-timeout 20 https://example.com
curl --connect-timeout 3.14 https://example.com
.fi
See also \fI\-\-max\-time\fP.
.IP "\-\-connect\-to "
For a request intended for the "HOST1:PORT1" pair, connect to "HOST2:PORT2"
instead. This option is only used to establish the network connection. It does
NOT affect the hostname/port number that is used for TLS/SSL (e.g. SNI,
certificate verification) or for the application protocols.
\&"HOST1" and "PORT1" may be empty strings, meaning any host or any port number.
\&"HOST2" and "PORT2" may also be empty strings, meaning use the request\(aqs
original hostname and port number.
A hostname specified to this option is compared as a string, so it needs to
match the name used in the request URL. It can be either numerical such as
\&"127.0.0.1" or the full hostname such as "example.org".
Example: redirect connects from the example.com hostname to 127.0.0.1
independently of port number:
.nf
curl \--connect\-to example.com::127.0.0.1: https://example.com/
.fi
Example: redirect connects from all hostnames to 127.0.0.1 independently of
port number:
.nf
curl \--connect\-to ::127.0.0.1: http://example.com/
.fi
\fI\-\-connect\-to\fP can be used several times in a command line.
Example:
.nf
curl --connect-to example.com:443:example.net:8443 https://example.com
.fi
See also \fI\-\-resolve\fP and \fI\-\-header\fP.
.IP "\-C, \-\-continue\-at "
Resume a previous transfer from the given byte offset. The given offset is the
exact number of bytes that are skipped, counting from the beginning of the
source file before it is transferred to the destination. If used with uploads,
the FTP server command SIZE is not used by curl.
Use "\-C \-" to instruct curl to automatically find out where/how to resume the
transfer. It then uses the given output/input files to figure that out.
When using this option for HTTP uploads using POST or PUT, functionality is
not guaranteed. The HTTP protocol has no standard interoperable resume upload
and curl uses a set of headers for this purpose that once proved working for
some servers and have been left for those who find that useful.
This command line option is mutually exclusive with \fI\-\-range\fP: you can only use
one of them for a single transfer.
The \fI\-\-no\-clobber\fP and \fI\-\-remove\-on\-error\fP options cannot be used together with
\fI\-\-continue\-at\fP.
If \fI\-\-continue\-at\fP is provided several times, the last set value is used.
Examples:
.nf
curl -C - https://example.com
curl -C 400 https://example.com
.fi
See also \fI\-\-range\fP.
.IP "\-b, \-\-cookie "
(HTTP) This option has two slightly separate cookie sending functions.
Either: pass the exact data to send to the HTTP server in the Cookie header.
It is supposedly data previously received from the server in a "Set\-Cookie:"
line. The data should be in the format "NAME1=VALUE1; NAME2=VALUE2". When
given a set of specific cookies, curl populates its cookie header with this
content explicitly in all outgoing request(s). If multiple requests are done
due to authentication, followed redirects or similar, they all get this cookie
header passed on.
Or: If no "=" symbol is used in the argument, it is instead treated as a
filename to read previously stored cookie from. This option also activates the
cookie engine which makes curl record incoming cookies, which may be handy if
you are using this in combination with the \fI\-\-location\fP option or do multiple
URL transfers on the same invoke.
If the filename is a single minus ("\-"), curl reads the contents from stdin.
If the filename is an empty string ("") and is the only cookie input, curl
activates the cookie engine without any cookies.
The file format of the file to read cookies from should be plain HTTP headers
(Set\-Cookie style) or the Netscape/Mozilla cookie file format.
The file specified with \fI\-\-cookie\fP is only used as input. No cookies are written
to that file. To store cookies, use the \fI\-\-cookie\-jar\fP option.
If you use the Set\-Cookie file format and do not specify a domain then the
cookie is not sent since the domain never matches. To address this, set a
domain in Set\-Cookie line (doing that includes subdomains) or preferably: use
the Netscape format.
Users often want to both read cookies from a file and write updated cookies
back to a file, so using both \fI\-\-cookie\fP and \fI\-\-cookie\-jar\fP in the same command
line is common. curl ignores filenames specified with \fI\-\-cookie\fP which do not
exist or point to a directory.
If curl is built with PSL (\fBPublic Suffix List\fP) support, it detects and
discards cookies that are specified for such suffix domains that should not be
allowed to have cookies. If curl is \fInot\fP built with PSL support, it has no
ability to stop super cookies.
\fI\-\-cookie\fP can be used several times in a command line.
Examples:
.nf
curl -b "" https://example.com
curl -b cookiefile https://example.com
curl -b cookiefile -c cookiefile https://example.com
curl -b name=Jane https://example.com
.fi
See also \fI\-\-cookie\-jar\fP and \fI\-\-junk\-session\-cookies\fP.
.IP "\-c, \-\-cookie\-jar "
(HTTP) Specify to which file you want curl to write all cookies after a completed
operation. curl writes all cookies from its in\-memory cookie storage to the
given file at the end of operations. Even if no cookies are known, a file is
created so that it removes any formerly existing cookies from the file. The
file uses the Netscape cookie file format. If you set the filename to a single
minus, "\-", the cookies are written to stdout.
The file specified with \fI\-\-cookie\-jar\fP is only used for output. No cookies are
read from the file. To read cookies, use the \fI\-\-cookie\fP option. Both options
can specify the same file.
This command line option activates the cookie engine that makes curl record
and use cookies. The \fI\-\-cookie\fP option also activates it.
If the cookie jar cannot be created or written to, the whole curl operation
does not fail or even report an error clearly. Using \fI\-\-verbose\fP gets a warning
displayed, but that is the only visible feedback you get about this possibly
lethal situation.
You may want to restrict your umask to prevent other users on the same system
to access the created file.
If \fI\-\-cookie\-jar\fP is provided several times, the last set value is used.
Examples:
.nf
curl -c store-here.txt https://example.com
curl -c store-here.txt -b read-these https://example.com
.fi
See also \fI\-\-cookie\fP and \fI\-\-junk\-session\-cookies\fP.
.IP "\-\-create\-dirs"
When used in conjunction with the \fI\-\-output\fP option, curl creates the necessary
local directory hierarchy as needed. This option creates the directories
mentioned with the \fI\-\-output\fP option combined with the path possibly set with
\fI\-\-output\-dir\fP. If the combined output filename uses no directory, or if the
directories it mentions already exist, no directories are created.
Created directories are made with mode 0750 on Unix\-style file systems.
To create remote directories when using FTP or SFTP, try \fI\-\-ftp\-create\-dirs\fP.
Providing \fI\-\-create\-dirs\fP multiple times has no extra effect.
Disable it again with \-\-no-create-dirs.
Example:
.nf
curl --create-dirs --output local/dir/file https://example.com
.fi
See also \fI\-\-ftp\-create\-dirs\fP and \fI\-\-output\-dir\fP.
.IP "\-\-create\-file\-mode "
(SFTP SCP FILE) When curl is used to create files remotely using one of the supported
protocols, this option allows the user to set which \(aqmode\(aq to set on the file
at creation time, instead of the default 0644.
This option takes an octal number as argument.
If \fI\-\-create\-file\-mode\fP is provided several times, the last set value is used.
Example:
.nf
curl --create-file-mode 0777 -T localfile sftp://example.com/new
.fi
Added in 7.75.0. See also \fI\-\-ftp\-create\-dirs\fP.
.IP "\-\-crlf"
(FTP SMTP) Convert line feeds to carriage return plus line feeds in upload. Useful for
\fBMVS (OS/390)\fP.
Providing \fI\-\-crlf\fP multiple times has no extra effect.
Disable it again with \-\-no-crlf.
Example:
.nf
curl --crlf -T file ftp://example.com/
.fi
See also \fI\-\-use\-ascii\fP.
.IP "\-\-crlfile "
(TLS) Provide a file using PEM format with a Certificate Revocation List that may
specify peer certificates that are to be considered revoked.
If \fI\-\-crlfile\fP is provided several times, the last set value is used.
Example:
.nf
curl --crlfile rejects.txt https://example.com
.fi
See also \fI\-\-cacert\fP and \fI\-\-capath\fP.
.IP "\-\-curves "
(TLS) Set specific curves to use during SSL session establishment according to RFC
8422, 5.1. Multiple algorithms can be provided by separating them with ":"
(e.g. "X25519:P\-521"). The parameter is available identically in the OpenSSL
\&"s_client" and "s_server" utilities.
\fI\-\-curves\fP allows a OpenSSL powered curl to make SSL\-connections with exactly
the (EC) curve requested by the client, avoiding nontransparent client/server
negotiations.
If this option is set, the default curves list built into OpenSSL are ignored.
If \fI\-\-curves\fP is provided several times, the last set value is used.
Example:
.nf
curl --curves X25519 https://example.com
.fi
Added in 7.73.0. See also \fI\-\-ciphers\fP.
.IP "\-d, \-\-data "
(HTTP MQTT) Send the specified data in a POST request to the HTTP server, in the same way
that a browser does when a user has filled in an HTML form and presses the
submit button. This option makes curl pass the data to the server using the
content\-type application/x\-www\-form\-urlencoded. Compared to \fI\-\-form\fP.
\fI\-\-data\-raw\fP is almost the same but does not have a special interpretation of
the @ character. To post data purely binary, you should instead use the
\fI\-\-data\-binary\fP option. To URL\-encode the value of a form field you may use
\fI\-\-data\-urlencode\fP.
If any of these options is used more than once on the same command line, the
data pieces specified are merged with a separating &\-symbol. Thus, using
\(aq\-d name=daniel \-d skill=lousy\(aq would generate a post chunk that looks like
\(aqname=daniel&skill=lousy\(aq.
If you start the data with the letter @, the rest should be a filename to read
the data from, or \- if you want curl to read the data from stdin. Posting data
from a file named \(aqfoobar\(aq would thus be done with \fI\-\-data\fP @foobar. When \fI\-\-data\fP
is told to read from a file like that, carriage returns, newlines and null
bytes are stripped out. If you do not want the @ character to have a special
interpretation use \fI\-\-data\-raw\fP instead.
The data for this option is passed on to the server exactly as provided on the
command line. curl does not convert, change or improve it. It is up to the
user to provide the data in the correct form.
\fI\-\-data\fP can be used several times in a command line.
Examples:
.nf
curl -d "name=curl" https://example.com
curl -d "name=curl" -d "tool=cmdline" https://example.com
curl -d @filename https://example.com
.fi
This option is mutually exclusive with \fI\-\-form\fP, \fI\-\-head\fP and \fI\-\-upload\-file\fP.
See also \fI\-\-data\-binary\fP, \fI\-\-data\-urlencode\fP and \fI\-\-data\-raw\fP.
.IP "\-\-data\-ascii "
(HTTP) This option is an alias for \fI\-\-data\fP.
\fI\-\-data\-ascii\fP can be used several times in a command line.
Example:
.nf
curl --data-ascii @file https://example.com
.fi
See also \fI\-\-data\-binary\fP, \fI\-\-data\-raw\fP and \fI\-\-data\-urlencode\fP.
.IP "\-\-data\-binary "
(HTTP) Post data exactly as specified with no extra processing whatsoever.
If you start the data with the letter @, the rest should be a filename.
\&"@\-" makes curl read the data from stdin. Data is posted in a similar
manner as \fI\-\-data\fP does, except that newlines and carriage returns are
preserved and conversions are never done.
Like \fI\-\-data\fP the default content\-type sent to the server is
application/x\-www\-form\-urlencoded. If you want the data to be treated as
arbitrary binary data by the server then set the content\-type to octet\-stream:
-H "Content\-Type: application/octet\-stream".
If this option is used several times, the ones following the first append
data as described in \fI\-\-data\fP.
\fI\-\-data\-binary\fP can be used several times in a command line.
Example:
.nf
curl --data-binary @filename https://example.com
.fi
See also \fI\-\-data\-ascii\fP.
.IP "\-\-data\-raw "
(HTTP) Post data similarly to \fI\-\-data\fP but without the special interpretation of the @
character.
\fI\-\-data\-raw\fP can be used several times in a command line.
Examples:
.nf
curl --data-raw "hello" https://example.com
curl --data-raw "@at@at@" https://example.com
.fi
See also \fI\-\-data\fP.
.IP "\-\-data\-urlencode "
(HTTP) Post data, similar to the other \fI\-\-data\fP options with the exception that this
performs URL\-encoding.
To be CGI\-compliant, the part should begin with a \fIname\fP followed by
a separator and a content specification. The part can be passed to
curl using one of the following syntaxes:
.RS
.IP content
URL\-encode the content and pass that on. Be careful so that the content does
not contain any "=" or "@" symbols, as that makes the syntax match one of the
other cases below.
.IP =content
URL\-encode the content and pass that on. The preceding "=" symbol is not
included in the data.
.IP name=content
URL\-encode the content part and pass that on. Note that the name part is
expected to be URL\-encoded already.
.IP @filename
load data from the given file (including any newlines), URL\-encode that data
and pass it on in the POST. Using "@\-" makes curl read the data from stdin.
.IP name@filename
load data from the given file (including any newlines), URL\-encode that data
and pass it on in the POST. The name part gets an equal sign appended,
resulting in \fIname=urlencoded\-file\-content\fP. Note that the name is expected to
be URL\-encoded already.
.RE
.IP
\fI\-\-data\-urlencode\fP can be used several times in a command line.
Examples:
.nf
curl --data-urlencode name=val https://example.com
curl --data-urlencode =encodethis https://example.com
curl --data-urlencode name@file https://example.com
curl --data-urlencode @fileonly https://example.com
.fi
See also \fI\-\-data\fP and \fI\-\-data\-raw\fP.
.IP "\-\-delegation "
(GSS/kerberos) Set LEVEL what curl is allowed to delegate when it comes to user credentials.
.RS
.IP none
Do not allow any delegation.
.IP policy
Delegates if and only if the OK\-AS\-DELEGATE flag is set in the Kerberos
service ticket, which is a matter of realm policy.
.IP always
Unconditionally allow the server to delegate.
.RE
.IP
If \fI\-\-delegation\fP is provided several times, the last set value is used.
Example:
.nf
curl --delegation "none" https://example.com
.fi
See also \fI\-\-insecure\fP and \fI\-\-ssl\fP.
.IP "\-\-digest"
(HTTP) Enable HTTP Digest authentication. This authentication scheme avoids sending
the password over the wire in clear text. Use this in combination with the
normal \fI\-\-user\fP option to set username and password.
Providing \fI\-\-digest\fP multiple times has no extra effect.
Disable it again with \-\-no-digest.
Example:
.nf
curl -u name:password --digest https://example.com
.fi
See also \fI\-\-user\fP, \fI\-\-proxy\-digest\fP and \fI\-\-anyauth\fP.
.IP "\-q, \-\-disable"
If used as the \fBfirst\fP parameter on the command line, the \fIcurlrc\fP config
file is not read or used. See the \fI\-\-config\fP for details on the default config
file search path.
Providing \fI\-\-disable\fP multiple times has no extra effect.
Disable it again with \-\-no-disable.
Example:
.nf
curl -q https://example.com
.fi
See also \fI\-\-config\fP.
.IP "\-\-disable\-eprt"
(FTP) Disable the use of the EPRT and LPRT commands when doing active FTP transfers.
curl normally first attempts to use EPRT before using PORT, but with this
option, it uses PORT right away. EPRT is an extension to the original FTP
protocol, and does not work on all servers, but enables more functionality in
a better way than the traditional PORT command.
\fI\-\-eprt\fP can be used to explicitly enable EPRT again and \fI\-\-no\-eprt\fP is an alias
for \fI\-\-disable\-eprt\fP.
If the server is accessed using IPv6, this option has no effect as EPRT is
necessary then.
Disabling EPRT only changes the active behavior. If you want to switch to
passive mode you need to not use \fI\-\-ftp\-port\fP or force it with \fI\-\-ftp\-pasv\fP.
Providing \fI\-\-disable\-eprt\fP multiple times has no extra effect.
Disable it again with \-\-no-disable-eprt.
Example:
.nf
curl --disable-eprt ftp://example.com/
.fi
See also \fI\-\-disable\-epsv\fP and \fI\-\-ftp\-port\fP.
.IP "\-\-disable\-epsv"
(FTP) Disable the use of the EPSV command when doing passive FTP transfers. curl
normally first attempts to use EPSV before PASV, but with this option, it does
not try EPSV.
\fI\-\-epsv\fP can be used to explicitly enable EPSV again and \fI\-\-no\-epsv\fP is an alias
for \fI\-\-disable\-epsv\fP.
If the server is an IPv6 host, this option has no effect as EPSV is necessary
then.
Disabling EPSV only changes the passive behavior. If you want to switch to
active mode you need to use \fI\-\-ftp\-port\fP.
Providing \fI\-\-disable\-epsv\fP multiple times has no extra effect.
Disable it again with \-\-no-disable-epsv.
Example:
.nf
curl --disable-epsv ftp://example.com/
.fi
See also \fI\-\-disable\-eprt\fP and \fI\-\-ftp\-port\fP.
.IP "\-\-disallow\-username\-in\-url"
Exit with error if passed a URL containing a username. Probably most useful
when the URL is being provided at runtime or similar.
Accepting and using credentials in a URL is normally considered a security
hazard as they are easily leaked that way.
Providing \fI\-\-disallow\-username\-in\-url\fP multiple times has no extra effect.
Disable it again with \-\-no-disallow-username-in-url.
Example:
.nf
curl --disallow-username-in-url https://example.com
.fi
See also \fI\-\-proto\fP.
.IP "\-\-dns\-interface "
(DNS) Send outgoing DNS requests through the given interface. This option is a
counterpart to \fI\-\-interface\fP (which does not affect DNS). The supplied string
must be an interface name (not an address).
If \fI\-\-dns\-interface\fP is provided several times, the last set value is used.
Example:
.nf
curl --dns-interface eth0 https://example.com
.fi
For \fI\-\-dns\-interface\fP to work, it requires that the underlying libcurl is built to support c-ares.
See also \fI\-\-dns\-ipv4\-addr\fP and \fI\-\-dns\-ipv6\-addr\fP.
.IP "\-\-dns\-ipv4\-addr "
(DNS) Bind to a specific IP address when making IPv4 DNS requests, so that the DNS
requests originate from this address. The argument should be a single IPv4
address.
If \fI\-\-dns\-ipv4\-addr\fP is provided several times, the last set value is used.
Example:
.nf
curl --dns-ipv4-addr 10.1.2.3 https://example.com
.fi
For \fI\-\-dns\-ipv4\-addr\fP to work, it requires that the underlying libcurl is built to support c-ares.
See also \fI\-\-dns\-interface\fP and \fI\-\-dns\-ipv6\-addr\fP.
.IP "\-\-dns\-ipv6\-addr "
(DNS) Bind to a specific IP address when making IPv6 DNS requests, so that the DNS
requests originate from this address. The argument should be a single IPv6
address.
If \fI\-\-dns\-ipv6\-addr\fP is provided several times, the last set value is used.
Example:
.nf
curl --dns-ipv6-addr 2a04:4e42::561 https://example.com
.fi
For \fI\-\-dns\-ipv6\-addr\fP to work, it requires that the underlying libcurl is built to support c-ares.
See also \fI\-\-dns\-interface\fP and \fI\-\-dns\-ipv4\-addr\fP.
.IP "\-\-dns\-servers "
(DNS) Set the list of DNS servers to be used instead of the system default. The list
of IP addresses should be separated with commas. Port numbers may also
optionally be given, appended to the IP address separated with a colon.
If \fI\-\-dns\-servers\fP is provided several times, the last set value is used.
Examples:
.nf
curl --dns-servers 192.168.0.1,192.168.0.2 https://example.com
curl --dns-servers 10.0.0.1:53 https://example.com
.fi
For \fI\-\-dns\-servers\fP to work, it requires that the underlying libcurl is built to support c-ares.
See also \fI\-\-dns\-interface\fP and \fI\-\-dns\-ipv4\-addr\fP.
.IP "\-\-doh\-cert\-status"
(DNS) Same as \fI\-\-cert\-status\fP but used for DoH (DNS\-over\-HTTPS).
Verify the status of the DoH servers\(aq certificate by using the Certificate
Status Request (aka. OCSP stapling) TLS extension.
If this option is enabled and the DoH server sends an invalid (e.g. expired)
response, if the response suggests that the server certificate has been
revoked, or no response at all is received, the verification fails.
This support is currently only implemented in the OpenSSL and GnuTLS backends.
Providing \fI\-\-doh\-cert\-status\fP multiple times has no extra effect.
Disable it again with \-\-no-doh-cert-status.
Example:
.nf
curl --doh-cert-status --doh-url https://doh.example https://example.com
.fi
Added in 7.76.0. See also \fI\-\-doh\-insecure\fP.
.IP "\-\-doh\-insecure"
(DNS) By default, every connection curl makes to a DoH server is verified to be
secure before the transfer takes place. This option tells curl to skip the
verification step and proceed without checking.
\fBWARNING\fP: using this option makes the DoH transfer and name resolution
insecure.
This option is equivalent to \fI\-\-insecure\fP and \fI\-\-proxy\-insecure\fP but used for DoH
(DNS\-over\-HTTPS) only.
Providing \fI\-\-doh\-insecure\fP multiple times has no extra effect.
Disable it again with \-\-no-doh-insecure.
Example:
.nf
curl --doh-insecure --doh-url https://doh.example https://example.com
.fi
Added in 7.76.0. See also \fI\-\-doh\-url\fP, \fI\-\-insecure\fP and \fI\-\-proxy\-insecure\fP.
.IP "\-\-doh\-url "
(DNS) Specify which DNS\-over\-HTTPS (DoH) server to use to resolve hostnames, instead
of using the default name resolver mechanism. The URL must be HTTPS.
Some SSL options that you set for your transfer also apply to DoH since the
name lookups take place over SSL. The certificate verification settings are
not inherited but are controlled separately via \fI\-\-doh\-insecure\fP and
\fI\-\-doh\-cert\-status\fP.
By default, DoH is bypassed when initially looking up DNS records of the DoH server. You can specify the IP address(es) of the DoH server with \fI\-\-resolve\fP to avoid this.
This option is unset if an empty string "" is used as the URL.
(Added in 7.85.0)
If \fI\-\-doh\-url\fP is provided several times, the last set value is used.
Examples:
.nf
curl --doh-url https://doh.example https://example.com
curl --doh-url https://doh.example --resolve doh.example:443:192.0.2.1 https://example.com
.fi
See also \fI\-\-doh\-insecure\fP.
.IP "\-\-dump\-ca\-embed"
(TLS) Write the CA bundle embedded in curl to standard output, then quit.
If curl was not built with a default CA bundle embedded, the output is empty.
Providing \fI\-\-dump\-ca\-embed\fP multiple times has no extra effect.
Disable it again with \-\-no-dump-ca-embed.
Example:
.nf
curl --dump-ca-embed
.fi
Added in 8.10.0. See also \fI\-\-ca\-native\fP, \fI\-\-cacert\fP, \fI\-\-capath\fP, \fI\-\-proxy\-ca\-native\fP, \fI\-\-proxy\-cacert\fP and \fI\-\-proxy\-capath\fP.
.IP "\-D, \-\-dump\-header "
(HTTP FTP) Write the received protocol headers to the specified file. If no headers are
received, the use of this option creates an empty file. Specify "\-" as
filename (a single minus) to have it written to stdout.
Starting in curl 8.10.0, specify "%" (a single percent sign) as filename
writes the output to stderr.
When used in FTP, the FTP server response lines are considered being "headers"
and thus are saved there.
Starting in curl 8.11.0, using the \fI\-\-create\-dirs\fP option can also create
missing directory components for the path provided in \fI\-\-dump\-header\fP.
Having multiple transfers in one set of operations (i.e. the URLs in one
\fI\-\-next\fP clause), appends them to the same file, separated by a blank line.
If \fI\-\-dump\-header\fP is provided several times, the last set value is used.
Examples:
.nf
curl --dump-header store.txt https://example.com
curl --dump-header - https://example.com -o save
.fi
See also \fI\-\-output\fP.
.IP "\-\-ech "
(HTTPS) Specify how to do ECH (Encrypted Client Hello).
The values allowed for can be:
.RS
.IP false
Do not attempt ECH. The is the default.
.IP grease
Send a GREASE ECH extension
.IP true
Attempt ECH if possible, but do not fail if ECH is not attempted.
(The connection fails if ECH is attempted but fails.)
.IP hard
Attempt ECH and fail if that is not possible. ECH only works with TLS 1.3 and
also requires using DoH or providing an ECHConfigList on the command line.
.IP ecl:
A base64 encoded ECHConfigList that is used for ECH.
.IP pn:
A name to use to over\-ride the "public_name" field of an ECHConfigList (only
available with OpenSSL TLS support)
.RE
.IP
Most ECH related errors cause error \fICURLE_ECH_REQUIRED\fP (101).
If \fI\-\-ech\fP is provided several times, the last set value is used.
Example:
.nf
curl --ech true https://example.com
.fi
Added in 8.8.0. See also \fI\-\-doh\-url\fP.
.IP "\-\-egd\-file "
(TLS) Deprecated option (added in 7.84.0). Prior to that it only had an effect on
curl if built to use old versions of OpenSSL.
Specify the path name to the Entropy Gathering Daemon socket. The socket is
used to seed the random engine for SSL connections.
If \fI\-\-egd\-file\fP is provided several times, the last set value is used.
Example:
.nf
curl --egd-file /random/here https://example.com
.fi
See also \fI\-\-random\-file\fP.
.IP "\-\-engine "
(TLS) Select the OpenSSL crypto engine to use for cipher operations. Use "\fI\-\-engine\fP
list" to print a list of build\-time supported engines. Note that not all (and
possibly none) of the engines may be available at runtime.
The OpenSSL concept "engines" has been superseded by "providers" in OpenSSL 3,
and this option should work fine to specify such as well.
If \fI\-\-engine\fP is provided several times, the last set value is used.
Example:
.nf
curl --engine flavor https://example.com
.fi
See also \fI\-\-ciphers\fP and \fI\-\-curves\fP.
.IP "\-\-etag\-compare "
(HTTP) Make a conditional HTTP request for the specific ETag read from the given file
by sending a custom If\-None\-Match header using the stored ETag.
For correct results, make sure that the specified file contains only a single
line with the desired ETag. A non\-existing or empty file is treated as an
empty ETag.
Use the option \fI\-\-etag\-save\fP to first save the ETag from a response, and then
use this option to compare against the saved ETag in a subsequent request.
Use this option with a single URL only.
If \fI\-\-etag\-compare\fP is provided several times, the last set value is used.
Example:
.nf
curl --etag-compare etag.txt https://example.com
.fi
Added in 7.68.0. See also \fI\-\-etag\-save\fP and \fI\-\-time\-cond\fP.
.IP "\-\-etag\-save "
(HTTP) Save an HTTP ETag to the specified file. An ETag is a caching related header,
usually returned in a response. Use this option with a single URL only.
If no ETag is sent by the server, an empty file is created.
In many situations you want to use an existing etag in the request to avoid
downloading the same resource again but also save the new etag if it has
indeed changed, by using both etag options \fI\-\-etag\-save\fP and \fI\-\-etag\-compare\fP with
the same filename, in the same command line.
Starting in curl 8.12.0, using the \fI\-\-create\-dirs\fP option can also create
missing directory components for the path provided in \fI\-\-etag\-save\fP.
If \fI\-\-etag\-save\fP is provided several times, the last set value is used.
Example:
.nf
curl --etag-save storetag.txt https://example.com
.fi
Added in 7.68.0. See also \fI\-\-etag\-compare\fP.
.IP "\-\-expect100\-timeout "
(HTTP) Maximum time in seconds that you allow curl to wait for a 100\-continue
response when curl emits an Expects: 100\-continue header in its request. By
default curl waits one second. This option accepts decimal values. When curl
stops waiting, it continues as if a response was received.
The decimal value needs to be provided using a dot (".") as decimal separator \-
not the local version even if it might be using another separator.
If \fI\-\-expect100\-timeout\fP is provided several times, the last set value is used.
Example:
.nf
curl --expect100-timeout 2.5 -T file https://example.com
.fi
See also \fI\-\-connect\-timeout\fP.
.IP "\-f, \-\-fail"
(HTTP) Fail with error code 22 and with no response body output at all for HTTP
transfers returning HTTP response codes at 400 or greater.
In normal cases when an HTTP server fails to deliver a document, it returns a
body of text stating so (which often also describes why and more) and a 4xx
HTTP response code. This command line option prevents curl from outputting
that data and instead returns error 22 early. By default, curl does not
consider HTTP response codes to indicate failure.
To get both the error code and also save the content, use \fI\-\-fail\-with\-body\fP
instead.
This method is not fail\-safe and there are occasions where non\-successful
response codes slip through, especially when authentication is involved
(response codes 401 and 407).
Providing \fI\-\-fail\fP multiple times has no extra effect.
Disable it again with \-\-no-fail.
Example:
.nf
curl --fail https://example.com
.fi
This option is mutually exclusive with \fI\-\-fail\-with\-body\fP.
See also \fI\-\-fail\-with\-body\fP and \fI\-\-fail\-early\fP.
.IP "\-\-fail\-early"
Fail and exit on the first detected transfer error.
When curl is used to do multiple transfers on the command line, it attempts to
operate on each given URL, one by one. By default, it ignores errors if there
are more URLs given and the last URL\(aqs success determines the error code curl
returns. Early failures are "hidden" by subsequent successful transfers.
Using this option, curl instead returns an error on the first transfer that
fails, independent of the amount of URLs that are given on the command
line. This way, no transfer failures go undetected by scripts and similar.
This option does not imply \fI\-\-fail\fP, which causes transfers to fail due to the
server\(aqs HTTP status code. You can combine the two options, however note \fI\-\-fail\fP
is not global and is therefore contained by \fI\-\-next\fP.
This option is global and does not need to be specified for each use of \fI\-\-next\fP.
Providing \fI\-\-fail\-early\fP multiple times has no extra effect.
Disable it again with \-\-no-fail-early.
Example:
.nf
curl --fail-early https://example.com https://two.example
.fi
See also \fI\-\-fail\fP and \fI\-\-fail\-with\-body\fP.
.IP "\-\-fail\-with\-body"
(HTTP) Return an error on server errors where the HTTP response code is 400 or
greater). In normal cases when an HTTP server fails to deliver a document, it
returns an HTML document stating so (which often also describes why and more).
This option allows curl to output and save that content but also to return
error 22.
This is an alternative option to \fI\-\-fail\fP which makes curl fail for the same
circumstances but without saving the content.
Providing \fI\-\-fail\-with\-body\fP multiple times has no extra effect.
Disable it again with \-\-no-fail-with-body.
Example:
.nf
curl --fail-with-body https://example.com
.fi
This option is mutually exclusive with \fI\-\-fail\fP.
Added in 7.76.0. See also \fI\-\-fail\fP and \fI\-\-fail\-early\fP.
.IP "\-\-false\-start"
(TLS) No TLS backend currently supports this feature.
Use false start during the TLS handshake. False start is a mode where a TLS
client starts sending application data before verifying the server\(aqs Finished
message, thus saving a round trip when performing a full handshake.
Providing \fI\-\-false\-start\fP multiple times has no extra effect.
Disable it again with \-\-no-false-start.
Example:
.nf
curl --false-start https://example.com
.fi
See also \fI\-\-tcp\-fastopen\fP.
.IP "\-\-follow"
(HTTP) Instructs curl to follow HTTP redirects and to do the custom request method
set with \fI\-\-request\fP when following redirects as the HTTP specification says.
The method string set with \fI\-\-request\fP is used in subsequent requests for the
status codes 307 or 308, but may be reset to GET for 301, 302 and 303.
This is subtly different than \fI\-\-location\fP, as that option always sets the custom
method in all subsequent requests independent of response code.
Restrict which protocols a redirect is accepted to follow with \fI\-\-proto\-redir\fP.
When \fI\-\-netrc\fP is used in combination with this option, credentials for the
followed\-to hosts may also be selected from that file.
Providing \fI\-\-follow\fP multiple times has no extra effect.
Disable it again with \-\-no-follow.
Example:
.nf
curl -X POST --follow https://example.com
.fi
Added in 8.16.0. See also \fI\-\-request\fP, \fI\-\-location\fP, \fI\-\-proto\-redir\fP and \fI\-\-max\-redirs\fP.
.IP "\-F, \-\-form "
(HTTP SMTP IMAP) For the HTTP protocol family, emulate a filled\-in form in which a user has
pressed the submit button. This makes curl POST data using the Content\-Type
multipart/form\-data according to RFC 2388.
For SMTP and IMAP protocols, this composes a multipart mail message to
transmit.
This enables uploading of binary files etc. To force the \(aqcontent\(aq part to be
a file, prefix the filename with an @ sign. To get the content part from a
file, prefix the filename with the symbol <. The difference between @ and <
is then that @ makes a file get attached in the post as a file upload, while
the < makes a text field and gets the contents for that text field from a
file.
Read content from stdin instead of a file by using a single "\-" as filename.
This goes for both @ and < constructs. When stdin is used, the contents is
buffered in memory first by curl to determine its size and allow a possible
resend. Defining a part\(aqs data from a named non\-regular file (such as a named
pipe or similar) is not subject to buffering and is instead read at
transmission time; since the full size is unknown before the transfer starts,
such data is sent as chunks by HTTP and rejected by IMAP.
Example: send an image to an HTTP server, where \(aqprofile\(aq is the name of the
form\-field to which the file \fBportrait.jpg\fP is the input:
.nf
curl \-F profile=@portrait.jpg https://example.com/upload.cgi
.fi
Example: send your name and shoe size in two text fields to the server:
.nf
curl \-F name=John \-F shoesize=11 https://example.com/
.fi
Example: send your essay in a text field to the server. Send it as a plain
text field, but get the contents for it from a local file:
.nf
curl \-F "story=HTML message