neulab/tldr huggingface dataset:
--crlfile <file> (TLS) Provide a file using PEM format with a Certificate Revocation List that may specify peer certificates that are to be considered revoked.
Example: curl --crlfile rejects.txt https://example.com
--curves <algorithm list> (TLS) Tells curl to request 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/s_server" utilities.
--curves allows a OpenSSL powered curl to make SSL-connections with exactly the (EC) curve requested by the client, avoiding intransparent client/server negotiations.
If this option is set, the default curves list built into openssl will be ignored.
Example: curl --curves X25519 https://example.com
Added in 7.73.0.
--data-ascii <data> (HTTP) This is just an alias for -d, --data.
Example: curl --data-ascii @file https://example.com
--data-binary <data> (HTTP) This posts data exactly as specified with no extra processing whatsoever.
If you start the data with the letter @, the rest should be a filename.  Data is posted in a similar manner as -d, --data does, except that newlines and carriage returns are preserved and conversions are never done.
Like -d, --data 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 will append data as described in -d, --data.
Example: curl --data-binary @filename https://example.com
--data-raw <data> (HTTP) This posts data similarly to -d, --data but without the special interpretation of the @ character.
Examples: curl --data-raw "hello" https://example.com curl --data-raw "@at@at@" https://example.com
See also -d, --data. Added in 7.43.0.
--data-urlencode <data> (HTTP) This posts data, similar to the other -d, --data options with the exception that this performs URL-encoding.
To be CGI-compliant, the <data> part should begin with a name followed by a separator and a content specification. The <data> part can be passed to curl using one of the following syntaxes:
content This will make curl URL-encode the content and pass that on. Just be careful so that the content does not contain any = or @ symbols, as that will then make the syntax match one of the other cases below!
=content This will make curl URL-encode the content and pass that on. The preceding = symbol is not included in the data.
name=content This will make curl URL-encode the content part and pass that on. Note that the name part is expected to be URL- encoded already.
@filename This will make curl load data from the given file (including any newlines), URL-encode that data and pass it on in the POST.
name@filename This will make curl 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 name=urlencoded-file-content. Note that the name is expected to be URL-encoded already.
Examples: 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
See also -d, --data and --data-raw.
-d, --data <data> (HTTP MQTT) Sends 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 will cause curl to pass the data to the server using the content-type application/x-www-form-urlencoded.  Compare to -F, --form.
--data-raw is almost the same but does not have a special interpretation of the @ character. To post data purely binary, you should instead use the --data-binary option.  To URL-encode the value of a form field you may use --data-urlencode.
If any of these options is used more than once on the same command line, the data pieces specified will be merged together with a separating &-symbol. Thus, using '-d name=daniel -d skill=lousy' would generate a post chunk that looks like 'name=daniel&skill=lousy'.
If you start the data with the letter @, the rest should be a file name to read the data from, or - if you want curl to read the data from stdin. Posting data from a file named 'foobar' would thus be done with -d, --data @foobar. When -d, --data is told to read from a file like that, carriage returns and newlines will be stripped out. If you do not want the @ character to have a special interpretation use --data-raw instead.
Examples: curl -d "name=curl" https://example.com curl -d "name=curl" -d "tool=cmdline" https://example.com curl -d @filename https://example.com
See also --data-binary, --data-urlencode and --data-raw. This option overrides -F, --form and -I, --head and -T, --upload-file.
--delegation <LEVEL> (GSS/kerberos) Set LEVEL to tell the server what it is allowed to delegate when it comes to user credentials.
none   Do not allow any delegation.
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.
always Unconditionally allow the server to delegate.
Example: curl --delegation "none" https://example.com
--digest (HTTP) Enables HTTP Digest authentication. This is an authentication scheme that prevents the password from being sent over the wire in clear text. Use this in combination with the normal -u, --user option to set user name and password.
If this option is used several times, only the first one is used.
Example: curl -u name:password --digest https://example.com
See also -u, --user, --proxy-digest and --anyauth. This option overrides --basic and --ntlm and --negotiate.
--disable-eprt (FTP) Tell curl to disable the use of the EPRT and LPRT commands when doing active FTP transfers. Curl will normally always first attempt to use EPRT, then LPRT before using PORT, but with this option, it will use PORT right away. EPRT and LPRT are extensions to the original FTP protocol, and may not work on all servers, but they enable more functionality in a better way than the traditional PORT command.
--eprt can be used to explicitly enable EPRT again and --no-eprt is an alias for --disable-eprt.
If the server is accessed using IPv6, this option will have 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 -P, --ftp-port or force it with --ftp-pasv.
Example: curl --disable-eprt ftp://example.com/
--disable-epsv (FTP) Tell curl to disable the use of the EPSV command when doing passive FTP transfers. Curl will normally always first attempt to use EPSV before PASV, but with this option, it will not try using EPSV.
--epsv can be used to explicitly enable EPSV again and --no-epsv is an alias for --disable-epsv.
If the server is an IPv6 host, this option will have 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 -P, --ftp-port.
Example: curl --disable-epsv ftp://example.com/
-q, --disable If used as the first parameter on the command line, the curlrc config file will not be read and used. See the -K, --config for details on the default config file search path.
Example: curl -q https://example.com
--disallow-username-in-url (HTTP) This tells curl to exit if passed a url containing a username. This is probably most useful when the URL is being provided at run-time or similar.
Example: curl --disallow-username-in-url https://example.com
See also --proto. Added in 7.61.0.
--dns-interface <interface> (DNS) Tell curl to send outgoing DNS requests through <interface>. This option is a counterpart to --interface (which does not affect DNS). The supplied string must be an interface name (not an address).
Example: curl --dns-interface eth0 https://example.com
See also --dns-ipv4-addr and --dns-ipv6-addr. --dns-interface requires that the underlying libcurl was built to support c-ares. Added in 7.33.0.
--dns-ipv4-addr <address> (DNS) Tell curl to bind to <ip-address> when making IPv4 DNS requests, so that the DNS requests originate from this address. The argument should be a single IPv4 address.
Example: curl --dns-ipv4-addr 10.1.2.3 https://example.com
See also --dns-interface and --dns-ipv6-addr. --dns-ipv4-addr requires that the underlying libcurl was built to support c-ares. Added in 7.33.0.
--dns-ipv6-addr <address> (DNS) Tell curl to bind to <ip-address> when making IPv6 DNS requests, so that the DNS requests originate from this address. The argument should be a single IPv6 address.
Example: curl --dns-ipv6-addr 2a04:4e42::561 https://example.com
See also --dns-interface and --dns-ipv4-addr. --dns-ipv6-addr requires that the underlying libcurl was built to support c-ares. Added in 7.33.0.
--dns-servers <addresses> 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 as :<port- number> after each IP address.
Example: curl --dns-servers 192.168.0.1,192.168.0.2 https://example.com
--dns-servers requires that the underlying libcurl was built to support c-ares. Added in 7.33.0.
--doh-cert-status (all) Same as --cert-status but used for DoH (DNS-over-HTTPS).
Example: curl --doh-cert-status --doh-url https://doh.example https://example.com
Added in 7.76.0.
--doh-insecure (all) Same as -k, --insecure but used for DoH (DNS-over-HTTPS).
Example: curl --doh-insecure --doh-url https://doh.example https://example.com
--doh-url <URL> (all) Specifies 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 will apply to DoH since the name lookups take place over SSL. However, the certificate verification settings are not inherited and can be controlled separately via --doh-insecure and --doh-cert-status.
Example: curl --doh-url https://doh.example https://example.com
Added in 7.62.0.
-D, --dump-header <filename> (HTTP FTP) Write the received protocol headers to the specified file. If no headers are received, the use of this option will create an empty file.
When used in FTP, the FTP server response lines are considered being "headers" and thus are saved there.
Example: curl --dump-header store.txt https://example.com
See also -o, --output.
--egd-file <file> (TLS) Specify the path name to the Entropy Gathering Daemon socket. The socket is used to seed the random engine for SSL connections.
Example: curl --egd-file /random/here https://example.com
See also --random-file.
--engine <name> (TLS) Select the OpenSSL crypto engine to use for cipher operations. Use --engine list to print a list of build-time supported engines. Note that not all (and possibly none) of the engines may be available at run-time.
Example: curl --engine flavor https://example.com
--etag-compare <file> (HTTP) This option makes 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. An empty file is parsed as an empty ETag.
Use the option --etag-save to first save the ETag from a response, and then use this option to compare against the saved ETag in a subsequent request.
Example: curl --etag-compare etag.txt https://example.com
Added in 7.68.0.
--etag-save <file> (HTTP) This option saves an HTTP ETag to the specified file. An ETag is a caching related header, usually returned in a response.
If no ETag is sent by the server, an empty file is created.
Example: curl --etag-save storetag.txt https://example.com
--expect100-timeout <seconds> (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 will wait one second. This option accepts decimal values! When curl stops waiting, it will continue as if the response has been received.
Example: curl --expect100-timeout 2.5 -T file https://example.com
See also --connect-timeout. Added in 7.47.0.
--fail-early Fail and exit on the first detected transfer error.
When curl is used to do multiple transfers on the command line, it will attempt to operate on each given URL, one by one. By default, it will ignore errors if there are more URLs given and the last URL's success will determine the error code curl returns. So early failures will be "hidden" by subsequent successful transfers.
Using this option, curl will instead return 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 is global and does not need to be specified for each use of -:, --next.
This option does not imply -f, --fail, which causes transfers to fail due to the server's HTTP status code. You can combine the two options, however note -f, --fail is not global and is therefore contained by -:, --next.
Example: curl --fail-early https://example.com https://two.example
Added in 7.52.0.
--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 flag will still allow curl to output and save that content but also to return error 22.
This is an alternative option to -f, --fail which makes curl fail for the same circumstances but without saving the content.
Example: curl --fail-with-body https://example.com
See also -f, --fail. Added in 7.76.0.
-f, --fail (HTTP) Fail silently (no output at all) on server errors. This is mostly done to enable scripts etc to better deal with failed attempts. 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 flag will prevent curl from outputting that and return error 22.
This method is not fail-safe and there are occasions where non- successful response codes will slip through, especially when authentication is involved (response codes 401 and 407).
Example: curl --fail https://example.com
See also --fail-with-body.
--false-start (TLS) Tells curl to use false start during the TLS handshake. False start is a mode where a TLS client will start sending application data before verifying the server's Finished message, thus saving a round trip when performing a full handshake.
This is currently only implemented in the NSS and Secure Transport (on iOS 7.0 or later, or OS X 10.9 or later) backends.
Example: curl --false-start https://example.com
Added in 7.42.0.
--form-string <name=string> (HTTP SMTP IMAP) Similar to -F, --form except that the value string for the named parameter is used literally. Leading '@' and '<' characters, and the ';type=' string in the value have no special meaning. Use this in preference to -F, --form if there's any possibility that the string value may accidentally trigger the '@' or '<' features of -F, --form.
Example: curl --form-string "data" https://example.com
See also -F, --form.
-F, --form <name=content> (HTTP SMTP IMAP) For HTTP protocol family, this lets curl emulate a filled-in form in which a user has pressed the submit button. This causes curl to POST data using the Content-Type multipart/form-data according to RFC 2388.
For SMTP and IMAP protocols, this is the means to compose a multipart mail message to transmit.
This enables uploading of binary files etc. To force the 'content' part to be a file, prefix the file name with an @ sign. To just get the content part from a file, prefix the file name 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 just get the contents for that text field from a file.
Tell curl to read content from stdin instead of a file by using - 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's data from a named non-regular file (such as a named pipe or similar) is unfortunately not subject to buffering and will be effectively 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 'profile' is the name of the form-field to which the file portrait.jpg will be the input:
curl -F profile=@portrait.jpg https://example.com/upload.cgi
Example: send your name and shoe size in two text fields to the server:
curl -F name=John -F shoesize=11 https://example.com/
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:
curl -F "story=<hugefile.txt" https://example.com/
You can also tell curl what Content-Type to use by using 'type=', in a manner similar to:
curl -F "web=@index.html;type=text/html" example.com
curl -F "name=daniel;type=text/foo" example.com
You can also explicitly change the name field of a file upload part by setting filename=, like this:
curl -F "file=@localfile;filename=nameinpost" example.com
If filename/path contains ',' or ';', it must be quoted by double- quotes like:
curl -F "file=@\"local,file\";filename=\"name;in;post\"" example.com
curl -F 'file=@"local,file";filename="name;in;post"' example.com
Note that if a filename/path is quoted by double-quotes, any double-quote or backslash within the filename must be escaped by backslash.
Quoting must also be applied to non-file data if it contains semicolons, leading/trailing spaces or leading double quotes:
curl -F 'colors="red; green; blue";type=text/x-myapp' example.com
You can add custom headers to the field by setting headers=, like
curl -F "submit=OK;headers=\"X-submit-type: OK\"" example.com
curl -F "submit=OK;headers=@headerfile" example.com
The headers= keyword may appear more that once and above notes about quoting apply. When headers are read from a file, Empty lines and lines starting with '#' are comments and ignored; each header can be folded by splitting between two words and starting the continuation line with a space; embedded carriage-returns and trailing spaces are stripped.  Here is an example of a header file contents:
# This file contain two headers. X-header-1: this is a header
# The following header is folded. X-header-2: this is another header
To support sending multipart mail messages, the syntax is extended as follows: - name can be omitted: the equal sign is the first character of the argument, - if data starts with '(', this signals to start a new multipart: it can be followed by a content type specification. - a multipart can be terminated with a '=)' argument.
Example: the following command sends an SMTP mime e-mail consisting in an inline part in two alternative formats: plain text and HTML. It attaches a text file:
curl -F '=(;type=multipart/alternative' \ -F '=plain text message' \ -F '= <body>HTML message</body>;type=text/html' \ -F '=)' -F '=@textfile.txt' ...  smtp://example.com
Data can be encoded for transfer using encoder=. Available encodings are binary and 8bit that do nothing else than adding the corresponding Content-Transfer-Encoding header, 7bit that only rejects 8-bit characters with a transfer error, quoted-printable and base64 that encodes data according to the corresponding schemes, limiting lines length to 76 characters.
Example: send multipart mail with a quoted-printable text message and a base64 attached file:
curl -F '=text message;encoder=quoted-printable' \ -F '=@localfile;encoder=base64' ... smtp://example.com
See further examples and details in the MANUAL.
Example: curl --form "name=curl" --form "file=@loadthis" https://example.com
This option overrides -d, --data and -I, --head and -T, --upload- file.
--ftp-account <data> (FTP) When an FTP server asks for "account data" after user name and password has been provided, this data is sent off using the ACCT command.
Example: curl --ftp-account "mr.robot" ftp://example.com/
--ftp-alternative-to-user <command> (FTP) If authenticating with the USER and PASS commands fails, send this command.  When connecting to Tumbleweed's Secure Transport server over FTPS using a client certificate, using "SITE AUTH" will tell the server to retrieve the username from the certificate.
Example: curl --ftp-alternative-to-user "U53r" ftp://example.com
--ftp-create-dirs (FTP SFTP) When an FTP or SFTP URL/operation uses a path that does not currently exist on the server, the standard behavior of curl is to fail. Using this option, curl will instead attempt to create missing directories.
Example: curl --ftp-create-dirs -T file ftp://example.com/remote/path/file
See also --create-dirs.
--ftp-method <method> (FTP) Control what method curl should use to reach a file on an FTP(S) server. The method argument should be one of the following alternatives:
multicwd curl does a single CWD operation for each path part in the given URL. For deep hierarchies this means many commands. This is how RFC 1738 says it should be done. This is the default but the slowest behavior.
nocwd  curl does no CWD at all. curl will do SIZE, RETR, STOR etc and give a full path to the server for all these commands. This is the fastest behavior.
singlecwd curl does one CWD with the full target directory and then operates on the file "normally" (like in the multicwd case). This is somewhat more standards compliant than 'nocwd' but without the full penalty of 'multicwd'.
Examples: curl --ftp-method multicwd ftp://example.com/dir1/dir2/file curl --ftp-method nocwd ftp://example.com/dir1/dir2/file curl --ftp-method singlecwd ftp://example.com/dir1/dir2/file
--ftp-pasv (FTP) Use passive mode for the data connection. Passive is the internal default behavior, but using this option can be used to override a previous -P, --ftp-port option.
If this option is used several times, only the first one is used. Undoing an enforced passive really is not doable but you must then instead enforce the correct -P, --ftp-port again.
Passive mode means that curl will try the EPSV command first and then PASV, unless --disable-epsv is used.
Example: curl --ftp-pasv ftp://example.com/
See also --disable-epsv.
-P, --ftp-port <address> (FTP) Reverses the default initiator/listener roles when connecting with FTP. This option makes curl use active mode. curl then tells the server to connect back to the client's specified address and port, while passive mode asks the server to setup an IP address and port for it to connect to. <address> should be one of:
interface e.g. "eth0" to specify which interface's IP address you want to use (Unix only)
IP address e.g. "192.168.10.1" to specify the exact IP address
host name e.g. "my.host.domain" to specify the machine
-      make curl pick the same IP address that is already used for the control connection
If this option is used several times, the last one will be used. Disable the use of PORT with --ftp-pasv. Disable the attempt to use the EPRT command instead of PORT by using --disable-eprt. EPRT is really PORT++.
You can also append ":[start]-[end]" to the right of the address, to tell curl what TCP port range to use. That means you specify a port range, from a lower to a higher number. A single number works as well, but do note that it increases the risk of failure since the port may not be available.
Examples: curl -P - ftp:/example.com curl -P eth0 ftp:/example.com curl -P 192.168.0.2 ftp:/example.com
See also --ftp-pasv and --disable-eprt.
--ftp-pret (FTP) Tell curl to send a PRET command before PASV (and EPSV). Certain FTP servers, mainly drftpd, require this non-standard command for directory listings as well as up and downloads in PASV mode.
Example: curl --ftp-pret ftp://example.com/
--ftp-skip-pasv-ip (FTP) Tell curl to not use the IP address the server suggests in its response to curl's PASV command when curl connects the data connection. Instead curl will re-use the same IP address it already uses for the control connection.
Since curl 7.74.0 this option is enabled by default.
This option has no effect if PORT, EPRT or EPSV is used instead of PASV.
Example: curl --ftp-skip-pasv-ip ftp://example.com/
See also --ftp-pasv.
--ftp-ssl-ccc-mode <active/passive> (FTP) Sets the CCC mode. The passive mode will not initiate the shutdown, but instead wait for the server to do it, and will not reply to the shutdown from the server. The active mode initiates the shutdown and waits for a reply from the server.
Example: curl --ftp-ssl-ccc-mode active --ftp-ssl-ccc ftps://example.com/
See also --ftp-ssl-ccc.
--ftp-ssl-ccc (FTP) Use CCC (Clear Command Channel) Shuts down the SSL/TLS layer after authenticating. The rest of the control channel communication will be unencrypted. This allows NAT routers to follow the FTP transaction. The default mode is passive.
Example: curl --ftp-ssl-ccc ftps://example.com/
See also --ssl and --ftp-ssl-ccc-mode.
--ftp-ssl-control (FTP) Require SSL/TLS for the FTP login, clear for transfer. Allows secure authentication, but non-encrypted data transfers for efficiency.  Fails the transfer if the server does not support SSL/TLS.
Example: curl --ftp-ssl-control ftp://example.com
-G, --get When used, this option will make all data specified with -d, --data, --data-binary or --data-urlencode to be used in an HTTP GET request instead of the POST request that otherwise would be used. The data will be appended to the URL with a '?' separator.
If used in combination with -I, --head, the POST data will instead be appended to the URL with a HEAD request.
If this option is used several times, only the first one is used. This is because undoing a GET does not make sense, but you should then instead enforce the alternative method you prefer.
Examples: curl --get https://example.com curl --get -d "tool=curl" -d "age=old" https://example.com curl --get -I -d "tool=curl" https://example.com
-g, --globoff This option switches off the "URL globbing parser". When you set this option, you can specify URLs that contain the letters {}[] without having curl itself interpret them. Note that these letters are not normal legal URL contents but they should be encoded according to the URI standard.
Example: curl -g "https://example.com/{[]}}}}"
--happy-eyeballs-timeout-ms <milliseconds> Happy Eyeballs is an algorithm that attempts to connect to both IPv4 and IPv6 addresses for dual-stack hosts, giving IPv6 a head- start of the specified number of milliseconds. If the IPv6 address cannot be connected to within that time, then a connection attempt is made to the IPv4 address in parallel. The first connection to be established is the one that is used.
The range of suggested useful values is limited. Happy Eyeballs RFC 6555 says "It is RECOMMENDED that connection attempts be paced 150-250 ms apart to balance human factors against network load." libcurl currently defaults to 200 ms. Firefox and Chrome currently default to 300 ms.
Example: curl --happy-eyeballs-timeout-ms 500 https://example.com
Added in 7.59.0.
--haproxy-protocol (HTTP) Send a HAProxy PROXY protocol v1 header at the beginning of the connection. This is used by some load balancers and reverse proxies to indicate the client's true IP address and port.
This option is primarily useful when sending test requests to a service that expects this header.
Example: curl --haproxy-protocol https://example.com
Added in 7.60.0.
-I, --head (HTTP FTP FILE) Fetch the headers only! HTTP-servers feature the command HEAD which this uses to get nothing but the header of a document. When used on an FTP or FILE file, curl displays the file size and last modification time only.
Example: curl -I https://example.com
-H, --header <header/@file> (HTTP) Extra header to include in the request when sending HTTP to a server. You may specify any number of extra headers. Note that if you should add a custom header that has the same name as one of the internal ones curl would use, your externally set header will be used instead of the internal one. This allows you to make even trickier stuff than curl would normally do. You should not replace internally set headers without knowing perfectly well what you are doing. Remove an internal header by giving a replacement without content on the right side of the colon, as in: -H "Host:". If you send the custom header with no-value then its header must be terminated with a semicolon, such as -H "X-Custom-Header;" to send "X-Custom-Header:".
curl will make sure that each header you add/replace is sent with the proper end-of-line marker, you should thus not add that as a part of the header content: do not add newlines or carriage returns, they will only mess things up for you.
This option can take an argument in @filename style, which then adds a header for each line in the input file. Using @- will make curl read the header file from stdin. Added in 7.55.0.
You need --proxy-header to send custom headers intended for a HTTP proxy. Added in 7.37.0.
Passing on a "Transfer-Encoding: chunked" header when doing a HTTP request with a request body, will make curl send the data using chunked encoding.
WARNING: headers set with this option will be set in all requests - even after redirects are followed, like when told with -L, --location. This can lead to the header being sent to other hosts than the original host, so sensitive headers should be used with caution combined with following redirects.
This option can be used multiple times to add/replace/remove multiple headers.
Examples: curl -H "X-First-Name: Joe" https://example.com curl -H "User-Agent: yes-please/2000" https://example.com curl -H "Host:" https://example.com
See also -A, --user-agent and -e, --referer.
-h, --help <category> Usage help. This lists all commands of the <category>.  If no arg was provided, curl will display the most important command line arguments.  If the argument "all" was provided, curl will display all options available.  If the argument "category" was provided, curl will display all categories and their meanings.
Example: curl --help all
--hostpubmd5 <md5> (SFTP SCP) Pass a string containing 32 hexadecimal digits. The string should be the 128 bit MD5 checksum of the remote host's public key, curl will refuse the connection with the host unless the md5sums match.
Example: curl --hostpubmd5 e5c1c49020640a5ab0f2034854c321a8 sftp://example.com/
--hostpubsha256 <sha256> (SFTP SCP) Pass a string containing a Base64-encoded SHA256 hash of the remote host's public key. Curl will refuse the connection with the host unless the hashes match.
Example: curl --hostpubsha256 NDVkMTQxMGQ1ODdmMjQ3MjczYjAyOTY5MmRkMjVmNDQ= sftp://example.com/
Added in 7.80.0.
--hsts <file name> (HTTPS) This option enables HSTS for the transfer. If the file name points to an existing HSTS cache file, that will be used. After a completed transfer, the cache will be saved to the file name again if it has been modified.
Specify a "" file name (zero length) to avoid loading/saving and make curl just handle HSTS in memory.
Example: curl --hsts cache.txt https://example.com
Added in 7.74.0.
--http0.9 (HTTP) Tells curl to be fine with HTTP version 0.9 response.
HTTP/0.9 is a completely headerless response and therefore you can also connect with this to non-HTTP servers and still get a response since curl will simply transparently downgrade - if allowed.
Since curl 7.66.0, HTTP/0.9 is disabled by default.
Example: curl --http0.9 https://example.com
Added in 7.64.0.
-0, --http1.0 (HTTP) Tells curl to use HTTP version 1.0 instead of using its internally preferred HTTP version.
Example: curl --http1.0 https://example.com
This option overrides --http1.1 and --http2.
--http1.1 (HTTP) Tells curl to use HTTP version 1.1.
Example: curl --http1.1 https://example.com
This option overrides -0, --http1.0 and --http2. Added in 7.33.0.
--http2-prior-knowledge (HTTP) Tells curl to issue its non-TLS HTTP requests using HTTP/2 without HTTP/1.1 Upgrade. It requires prior knowledge that the server supports HTTP/2 straight away. HTTPS requests will still do HTTP/2 the standard way with negotiated protocol version in the TLS handshake.
Example: curl --http2-prior-knowledge https://example.com
--http2-prior-knowledge requires that the underlying libcurl was built to support HTTP/2. This option overrides --http1.1 and -0, --http1.0 and --http2. Added in 7.49.0.
--http2 (HTTP) Tells curl to use HTTP version 2.
For HTTPS, this means curl will attempt to negotiate HTTP/2 in the TLS handshake. curl does this by default.
For HTTP, this means curl will attempt to upgrade the request to HTTP/2 using the Upgrade: request header.
Example: curl --http2 https://example.com
See also --http1.1 and --http3. --http2 requires that the underlying libcurl was built to support HTTP/2. This option overrides --http1.1 and -0, --http1.0 and --http2-prior-knowledge. Added in 7.33.0.
--http3 (HTTP) WARNING: this option is experimental. Do not use in production.
Tells curl to use HTTP version 3 directly to the host and port number used in the URL. A normal HTTP/3 transaction will be done to a host and then get redirected via Alt-Svc, but this option allows a user to circumvent that when you know that the target speaks HTTP/3 on the given host and port.
This option will make curl fail if a QUIC connection cannot be established, it cannot fall back to a lower HTTP version on its own.
Example: curl --http3 https://example.com
See also --http1.1 and --http2. --http3 requires that the underlying libcurl was built to support HTTP/3. This option overrides --http1.1 and -0, --http1.0 and --http2 and --http2-prior-knowledge. Added in 7.66.0.
--ignore-content-length (FTP HTTP) For HTTP, Ignore the Content-Length header. This is particularly useful for servers running Apache 1.x, which will report incorrect Content-Length for files larger than 2 gigabytes.
For FTP (since 7.46.0), skip the RETR command to figure out the size before downloading a file.
This option does not work for HTTP if libcurl was built to use hyper.
Example: curl --ignore-content-length https://example.com
-i, --include Include the HTTP response headers in the output. The HTTP response headers can include things like server name, cookies, date of the document, HTTP version and more...
To view the request headers, consider the -v, --verbose option.
Example: curl -i https://example.com
See also -v, --verbose.
-k, --insecure (TLS) By default, every SSL connection curl makes is verified to be secure. This option allows curl to proceed and operate even for server connections otherwise considered insecure.
The server connection is verified by making sure the server's certificate contains the right name and verifies successfully using the cert store.
See this online resource for further details: https://curl.se/docs/sslcerts.html
WARNING: this makes the transfer insecure.
Example: curl --insecure https://example.com
See also --proxy-insecure and --cacert.
--interface <name> Perform an operation using a specified interface. You can enter interface name, IP address or host name. An example could look like:
curl --interface eth0:1 https://www.example.com/
On Linux it can be used to specify a VRF, but the binary needs to either have CAP_NET_RAW or to be run as root. More information about Linux VRF: https://www.kernel.org/doc/Documentation/networking/vrf.txt
Example: curl --interface eth0 https://example.com
See also --dns-interface.
-4, --ipv4 This option tells curl to resolve names to IPv4 addresses only, and not for example try IPv6.
Example: curl --ipv4 https://example.com
See also --http1.1 and --http2. This option overrides -6, --ipv6.
-6, --ipv6 This option tells curl to resolve names to IPv6 addresses only, and not for example try IPv4.
Example: curl --ipv6 https://example.com
See also --http1.1 and --http2. This option overrides -4, --ipv4.
-j, --junk-session-cookies (HTTP) When curl is told to read cookies from a given file, this option will make it discard all "session cookies". This will basically have the same effect as if a new session is started. Typical browsers always discard session cookies when they are closed down.
Example: curl --junk-session-cookies -b cookies.txt https://example.com
See also -b, --cookie and -c, --cookie-jar.
--keepalive-time <seconds> This option sets the time a connection needs to remain idle before sending keepalive probes and the time between individual keepalive probes. It is currently effective on operating systems offering the TCP_KEEPIDLE and TCP_KEEPINTVL socket options (meaning Linux, recent AIX, HP-UX and more). This option has no effect if --no- keepalive is used.
If this option is used several times, the last one will be used. If unspecified, the option defaults to 60 seconds.
Example: curl --keepalive-time 20 https://example.com
--key-type <type> (TLS) Private key file type. Specify which type your --key provided private key is. DER, PEM, and ENG are supported. If not specified, PEM is assumed.
Example: curl --key-type DER --key here https://example.com
--key <key> (TLS SSH) Private key file name. Allows you to provide your private key in this separate file. For SSH, if not specified, curl tries the following candidates in order: '~/.ssh/id_rsa', '~/.ssh/id_dsa', './id_rsa', './id_dsa'.
If curl is built against OpenSSL library, and the engine pkcs11 is available, then a PKCS#11 URI (RFC 7512) can be used to specify a private key located in a PKCS#11 device. A string beginning with "pkcs11:" will be interpreted as a PKCS#11 URI. If a PKCS#11 URI is provided, then the --engine option will be set as "pkcs11" if none was provided and the --key-type option will be set as "ENG" if none was provided.
Example: curl --cert certificate --key here https://example.com
--krb <level> (FTP) Enable Kerberos authentication and use. The level must be entered and should be one of 'clear', 'safe', 'confidential', or 'private'. Should you use a level that is not one of these, 'private' will instead be used.
Example: curl --krb clear ftp://example.com/
--krb requires that the underlying libcurl was built to support Kerberos.
--libcurl <file> Append this option to any ordinary curl command line, and you will get libcurl-using C source code written to the file that does the equivalent of what your command-line operation does!
If this option is used several times, the last given file name will be used.
Example: curl --libcurl client.c https://example.com
--limit-rate <speed> Specify the maximum transfer rate you want curl to use - for both downloads and uploads. This feature is useful if you have a limited pipe and you would like your transfer not to use your entire bandwidth. To make it slower than it otherwise would be.
The given speed is measured in bytes/second, unless a suffix is appended.  Appending 'k' or 'K' will count the number as kilobytes, 'm' or 'M' makes it megabytes, while 'g' or 'G' makes it gigabytes. The suffixes (k, M, G, T, P) are 1024 based. For example 1k is 1024. Examples: 200K, 3m and 1G.
The rate limiting logic works on averaging the transfer speed to no more than the set threshold over a period of multiple seconds.
If you also use the -Y, --speed-limit option, that option will take precedence and might cripple the rate-limiting slightly, to help keeping the speed-limit logic working.
Examples: curl --limit-rate 100K https://example.com curl --limit-rate 1000 https://example.com curl --limit-rate 10M https://example.com
-l, --list-only (FTP POP3) (FTP) When listing an FTP directory, this switch forces a name-only view. This is especially useful if the user wants to machine-parse the contents of an FTP directory since the normal directory view does not use a standard look or format. When used like this, the option causes an NLST command to be sent to the server instead of LIST.
Note: Some FTP servers list only files in their response to NLST; they do not include sub-directories and symbolic links.
(POP3) When retrieving a specific email from POP3, this switch forces a LIST command to be performed instead of RETR. This is particularly useful if the user wants to see if a specific message-id exists on the server and what size it is.
Note: When combined with -X, --request, this option can be used to send a UIDL command instead, so the user may use the email's unique identifier rather than its message-id to make the request.
Example: curl --list-only ftp://example.com/dir/
--local-port <num/range> Set a preferred single number or range (FROM-TO) of local port numbers to use for the connection(s).  Note that port numbers by nature are a scarce resource that will be busy at times so setting this range to something too narrow might cause unnecessary connection setup failures.
Example: curl --local-port 1000-3000 https://example.com
--location-trusted (HTTP) Like -L, --location, but will allow sending the name + password to all hosts that the site may redirect to. This may or may not introduce a security breach if the site redirects you to a site to which you will send your authentication info (which is plaintext in the case of HTTP Basic authentication).
Example: curl --location-trusted -u user:password https://example.com
See also -u, --user.
-L, --location (HTTP) If the server reports that the requested page has moved to a different location (indicated with a Location: header and a 3XX response code), this option will make curl redo the request on the new place. If used together with -i, --include or -I, --head, headers from all requested pages will be shown. When authentication is used, curl only sends its credentials to the initial host. If a redirect takes curl to a different host, it will not be able to intercept the user+password. See also --location-trusted on how to change this. You can limit the amount of redirects to follow by using the --max-redirs option.
When curl follows a redirect and if the request is a POST, it will send the following request with a GET if the HTTP response was 301, 302, or 303. If the response code was any other 3xx code, curl will re-send the following request using the same unmodified method.
You can tell curl to not change POST requests to GET after a 30x response by using the dedicated options for that: --post301, --post302 and --post303.
The method set with -X, --request overrides the method curl would otherwise select to use.
Example: curl -L https://example.com
--login-options <options> (IMAP POP3 SMTP) Specify the login options to use during server authentication.
You can use login options to specify protocol specific options that may be used during authentication. At present only IMAP, POP3 and SMTP support login options. For more information about login options please see RFC 2384, RFC 5092 and IETF draft draft- earhart-url-smtp-00.txt
Example: curl --login-options 'AUTH=*' imap://example.com
Added in 7.34.0.
--mail-auth <address> (SMTP) Specify a single address. This will be used to specify the authentication address (identity) of a submitted message that is being relayed to another server.
Example: curl --mail-auth user@example.come -T mail smtp://example.com/
See also --mail-rcpt and --mail-from.
--mail-from <address> (SMTP) Specify a single address that the given mail should get sent from.
Example: curl --mail-from user@example.com -T mail smtp://example.com/
See also --mail-rcpt and --mail-auth.
--mail-rcpt-allowfails (SMTP) When sending data to multiple recipients, by default curl will abort SMTP conversation if at least one of the recipients causes RCPT TO command to return an error.
The default behavior can be changed by passing --mail-rcpt- allowfails command-line option which will make curl ignore errors and proceed with the remaining valid recipients.
If all recipients trigger RCPT TO failures and this flag is specified, curl will still abort the SMTP conversation and return the error received from to the last RCPT TO command.
Example: curl --mail-rcpt-allowfails --mail-rcpt dest@example.com smtp://example.com
Added in 7.69.0.
--mail-rcpt <address> (SMTP) Specify a single e-mail address, user name or mailing list name. Repeat this option several times to send to multiple recipients.
When performing an address verification (VRFY command), the recipient should be specified as the user name or user name and domain (as per Section 3.5 of RFC5321). (Added in 7.34.0)
When performing a mailing list expand (EXPN command), the recipient should be specified using the mailing list name, such as "Friends" or "London-Office".  (Added in 7.34.0)
Example: curl --mail-rcpt user@example.net smtp://example.com
-M, --manual Manual. Display the huge help text.
Example: curl --manual
--max-filesize <bytes> (FTP HTTP MQTT) Specify the maximum size (in bytes) of a file to download. If the file requested is larger than this value, the transfer will not start and curl will return with exit code 63.
A size modifier may be used. For example, Appending 'k' or 'K' will count the number as kilobytes, 'm' or 'M' makes it megabytes, while 'g' or 'G' makes it gigabytes. Examples: 200K, 3m and 1G. (Added in 7.58.0)
NOTE: The file size is not always known prior to download, and for such files this option has no effect even if the file transfer ends up being larger than this given limit.  Example: curl --max-filesize 100K https://example.com
See also --limit-rate.
--max-redirs <num> (HTTP) Set maximum number of redirections to follow. When -L, --location is used, to prevent curl from following too many redirects, by default, the limit is set to 50 redirects. Set this option to -1 to make it unlimited.
Example: curl --max-redirs 3 --location https://example.com
-m, --max-time <fractional seconds> Maximum time in seconds that you allow the whole operation to take.  This is useful for preventing your batch jobs from hanging for hours due to slow networks or links going down.  Since 7.32.0, this option accepts decimal values, but the actual timeout will decrease in accuracy as the specified timeout increases in decimal precision.
Examples: curl --max-time 10 https://example.com curl --max-time 2.92 https://example.com
See also --connect-timeout.
--metalink This option was previously used to specify a metalink resource. Metalink support has been disabled in curl since 7.78.0 for security reasons.
Example: curl --metalink file https://example.com
--negotiate (HTTP) Enables Negotiate (SPNEGO) authentication.
This option requires a library built with GSS-API or SSPI support. Use -V, --version to see if your curl supports GSS-API/SSPI or SPNEGO.
When using this option, you must also provide a fake -u, --user option to activate the authentication code properly. Sending a '-u :' is enough as the user name and password from the -u, --user option are not actually used.
Example: curl --negotiate -u : https://example.com
See also --basic, --ntlm, --anyauth and --proxy-negotiate.
--netrc-file <filename> This option is similar to -n, --netrc, except that you provide the path (absolute or relative) to the netrc file that curl should use.  You can only specify one netrc file per invocation. If several --netrc-file options are provided, the last one will be used.
It will abide by --netrc-optional if specified.
Example: curl --netrc-file netrc https://example.com
This option overrides -n, --netrc.
--netrc-optional Similar to -n, --netrc, but this option makes the .netrc usage optional and not mandatory as the -n, --netrc option does.
Example: curl --netrc-optional https://example.com
See also --netrc-file. This option overrides -n, --netrc.
-n, --netrc Makes curl scan the .netrc (_netrc on Windows) file in the user's home directory for login name and password. This is typically used for FTP on Unix. If used with HTTP, curl will enable user authentication. See netrc(5) and ftp(1) for details on the file format. Curl will not complain if that file does not have the right permissions (it should be neither world- nor group- readable). The environment variable "HOME" is used to find the home directory.
A quick and simple example of how to setup a .netrc to allow curl to FTP to the machine host.domain.com with user name 'myself' and password 'secret' should look similar to:
machine host.domain.com login myself password secret
Example: curl --netrc https://example.com
-:, --next Tells curl to use a separate operation for the following URL and associated options. This allows you to send several URL requests, each with their own specific options, for example, such as different user names or custom requests for each.