xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame] | 1 | .\" ************************************************************************** |
| 2 | .\" * _ _ ____ _ |
| 3 | .\" * Project ___| | | | _ \| | |
| 4 | .\" * / __| | | | |_) | | |
| 5 | .\" * | (__| |_| | _ <| |___ |
| 6 | .\" * \___|\___/|_| \_\_____| |
| 7 | .\" * |
| 8 | .\" * Copyright (C) 1998 \- 2022, Daniel Stenberg, <daniel@haxx.se>, et al. |
| 9 | .\" * |
| 10 | .\" * This software is licensed as described in the file COPYING, which |
| 11 | .\" * you should have received as part of this distribution. The terms |
| 12 | .\" * are also available at https://curl.se/docs/copyright.html. |
| 13 | .\" * |
| 14 | .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell |
| 15 | .\" * copies of the Software, and permit persons to whom the Software is |
| 16 | .\" * furnished to do so, under the terms of the COPYING file. |
| 17 | .\" * |
| 18 | .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
| 19 | .\" * KIND, either express or implied. |
| 20 | .\" * |
| 21 | .\" * SPDX-License-Identifier: curl |
| 22 | .\" * |
| 23 | .\" ************************************************************************** |
| 24 | .\" |
| 25 | .\" DO NOT EDIT. Generated by the curl project gen.pl man page generator. |
| 26 | .\" |
| 27 | .TH curl 1 "October 23 2022" "curl 7.86.0" "curl Manual" |
| 28 | .SH NAME |
| 29 | curl \- transfer a URL |
| 30 | .SH SYNOPSIS |
| 31 | .B curl [options / URLs] |
| 32 | .SH DESCRIPTION |
| 33 | \fBcurl\fP is a tool for transferring data from or to a server. It supports these |
| 34 | protocols: DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, |
| 35 | LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, |
| 36 | SMTPS, TELNET, TFTP, WS and WSS. The command is designed to work without user |
| 37 | interaction. |
| 38 | |
| 39 | curl offers a busload of useful tricks like proxy support, user |
| 40 | authentication, FTP upload, HTTP post, SSL connections, cookies, file transfer |
| 41 | resume and more. As you will see below, the number of features will make your |
| 42 | head spin. |
| 43 | |
| 44 | curl is powered by libcurl for all transfer-related features. See |
| 45 | \fIlibcurl(3)\fP for details. |
| 46 | .SH URL |
| 47 | The URL syntax is protocol-dependent. You find a detailed description in |
| 48 | RFC 3986. |
| 49 | |
| 50 | You can specify multiple URLs or parts of URLs by writing part sets within |
| 51 | braces and quoting the URL as in: |
| 52 | |
| 53 | .nf |
| 54 | \(dqhttp://site.{one,two,three}.com" |
| 55 | .fi |
| 56 | |
| 57 | or you can get sequences of alphanumeric series by using [] as in: |
| 58 | |
| 59 | .nf |
| 60 | \(dqftp://ftp.example.com/file[1-100].txt" |
| 61 | .fi |
| 62 | |
| 63 | .nf |
| 64 | \(dqftp://ftp.example.com/file[001-100].txt" (with leading zeros) |
| 65 | .fi |
| 66 | |
| 67 | .nf |
| 68 | \(dqftp://ftp.example.com/file[a-z].txt" |
| 69 | .fi |
| 70 | |
| 71 | Nested sequences are not supported, but you can use several ones next to each |
| 72 | other: |
| 73 | |
| 74 | .nf |
| 75 | \(dqhttp://example.com/archive[1996-1999]/vol[1-4]/part{a,b,c}.html" |
| 76 | .fi |
| 77 | |
| 78 | You can specify any amount of URLs on the command line. They will be fetched |
| 79 | in a sequential manner in the specified order. You can specify command line |
| 80 | options and URLs mixed and in any order on the command line. |
| 81 | |
| 82 | You can specify a step counter for the ranges to get every Nth number or |
| 83 | letter: |
| 84 | |
| 85 | .nf |
| 86 | \(dqhttp://example.com/file[1-100:10].txt" |
| 87 | .fi |
| 88 | |
| 89 | .nf |
| 90 | \(dqhttp://example.com/file[a-z:2].txt" |
| 91 | .fi |
| 92 | |
| 93 | When using [] or {} sequences when invoked from a command line prompt, you |
| 94 | probably have to put the full URL within double quotes to avoid the shell from |
| 95 | interfering with it. This also goes for other characters treated special, like |
| 96 | for example '&', '?' and '*'. |
| 97 | |
| 98 | Provide the IPv6 zone index in the URL with an escaped percentage sign and the |
| 99 | interface name. Like in |
| 100 | |
| 101 | .nf |
| 102 | \(dqhttp://[fe80::3%25eth0]/" |
| 103 | .fi |
| 104 | |
| 105 | If you specify URL without protocol:// prefix, curl will attempt to guess what |
| 106 | protocol you might want. It will then default to HTTP but try other protocols |
| 107 | based on often-used host name prefixes. For example, for host names starting |
| 108 | with "ftp." curl will assume you want to speak FTP. |
| 109 | |
| 110 | curl will do its best to use what you pass to it as a URL. It is not trying to |
| 111 | validate it as a syntactically correct URL by any means but is fairly liberal |
| 112 | with what it accepts. |
| 113 | |
| 114 | curl will attempt to re-use connections for multiple file transfers, so that |
| 115 | getting many files from the same server will not do multiple connects / |
| 116 | handshakes. This improves speed. Of course this is only done on files |
| 117 | specified on a single command line and cannot be used between separate curl |
| 118 | invocations. |
| 119 | .SH OUTPUT |
| 120 | If not told otherwise, curl writes the received data to stdout. It can be |
| 121 | instructed to instead save that data into a local file, using the \-\-output or |
| 122 | \-\-remote-name options. If curl is given multiple URLs to transfer on the |
| 123 | command line, it similarly needs multiple options for where to save them. |
| 124 | |
| 125 | curl does not parse or otherwise "understand" the content it gets or writes as |
| 126 | output. It does no encoding or decoding, unless explicitly asked to with |
| 127 | dedicated command line options. |
| 128 | .SH PROTOCOLS |
| 129 | curl supports numerous protocols, or put in URL terms: schemes. Your |
| 130 | particular build may not support them all. |
| 131 | .IP DICT |
| 132 | Lets you lookup words using online dictionaries. |
| 133 | .IP FILE |
| 134 | Read or write local files. curl does not support accessing file:// URL |
| 135 | remotely, but when running on Microsoft Windows using the native UNC approach |
| 136 | will work. |
| 137 | .IP FTP(S) |
| 138 | curl supports the File Transfer Protocol with a lot of tweaks and levers. With |
| 139 | or without using TLS. |
| 140 | .IP GOPHER(S) |
| 141 | Retrieve files. |
| 142 | .IP HTTP(S) |
| 143 | curl supports HTTP with numerous options and variations. It can speak HTTP |
| 144 | version 0.9, 1.0, 1.1, 2 and 3 depending on build options and the correct |
| 145 | command line options. |
| 146 | .IP IMAP(S) |
| 147 | Using the mail reading protocol, curl can "download" emails for you. With or |
| 148 | without using TLS. |
| 149 | .IP LDAP(S) |
| 150 | curl can do directory lookups for you, with or without TLS. |
| 151 | .IP MQTT |
| 152 | curl supports MQTT version 3. Downloading over MQTT equals "subscribe" to a |
| 153 | topic while uploading/posting equals "publish" on a topic. MQTT over TLS is |
| 154 | not supported (yet). |
| 155 | .IP POP3(S) |
| 156 | Downloading from a pop3 server means getting a mail. With or without using |
| 157 | TLS. |
| 158 | .IP RTMP(S) |
| 159 | The Realtime Messaging Protocol is primarily used to server streaming media |
| 160 | and curl can download it. |
| 161 | .IP RTSP |
| 162 | curl supports RTSP 1.0 downloads. |
| 163 | .IP SCP |
| 164 | curl supports SSH version 2 scp transfers. |
| 165 | .IP SFTP |
| 166 | curl supports SFTP (draft 5) done over SSH version 2. |
| 167 | .IP SMB(S) |
| 168 | curl supports SMB version 1 for upload and download. |
| 169 | .IP SMTP(S) |
| 170 | Uploading contents to an SMTP server means sending an email. With or without |
| 171 | TLS. |
| 172 | .IP TELNET |
| 173 | Telling curl to fetch a telnet URL starts an interactive session where it |
| 174 | sends what it reads on stdin and outputs what the server sends it. |
| 175 | .IP TFTP |
| 176 | curl can do TFTP downloads and uploads. |
| 177 | .SH "PROGRESS METER" |
| 178 | curl normally displays a progress meter during operations, indicating the |
| 179 | amount of transferred data, transfer speeds and estimated time left, etc. The |
| 180 | progress meter displays number of bytes and the speeds are in bytes per |
| 181 | second. The suffixes (k, M, G, T, P) are 1024 based. For example 1k is 1024 |
| 182 | bytes. 1M is 1048576 bytes. |
| 183 | |
| 184 | curl displays this data to the terminal by default, so if you invoke curl to |
| 185 | do an operation and it is about to write data to the terminal, it |
| 186 | \fIdisables\fP the progress meter as otherwise it would mess up the output |
| 187 | mixing progress meter and response data. |
| 188 | |
| 189 | If you want a progress meter for HTTP POST or PUT requests, you need to |
| 190 | redirect the response output to a file, using shell redirect (>), \-\-output or |
| 191 | similar. |
| 192 | |
| 193 | This does not apply to FTP upload as that operation does not spit out any |
| 194 | response data to the terminal. |
| 195 | |
| 196 | If you prefer a progress "bar" instead of the regular meter, \-\-progress-bar is |
| 197 | your friend. You can also disable the progress meter completely with the |
| 198 | \-\-silent option. |
| 199 | .SH OPTIONS |
| 200 | Options start with one or two dashes. Many of the options require an |
| 201 | additional value next to them. |
| 202 | |
| 203 | The short "single-dash" form of the options, \-d for example, may be used with |
| 204 | or without a space between it and its value, although a space is a recommended |
| 205 | separator. The long "double-dash" form, \-\-data for example, requires a space |
| 206 | between it and its value. |
| 207 | |
| 208 | Short version options that do not need any additional values can be used |
| 209 | immediately next to each other, like for example you can specify all the |
| 210 | options \-O, \-L and \-v at once as \-OLv. |
| 211 | |
| 212 | In general, all boolean options are enabled with \-\-\fBoption\fP and yet again |
| 213 | disabled with \-\-\fBno-\fPoption. That is, you use the same option name but |
| 214 | prefix it with "no-". However, in this list we mostly only list and show the |
| 215 | \-\-option version of them. |
| 216 | .IP "\-\-abstract-unix-socket <path>" |
| 217 | (HTTP) Connect through an abstract Unix domain socket, instead of using the network. |
| 218 | Note: netstat shows the path of an abstract socket prefixed with '@', however |
| 219 | the <path> argument should not have this leading character. |
| 220 | |
| 221 | If --abstract-unix-socket is provided several times, the last set value will be used. |
| 222 | |
| 223 | Example: |
| 224 | .nf |
| 225 | curl --abstract-unix-socket socketpath https://example.com |
| 226 | .fi |
| 227 | |
| 228 | See also \fI--unix-socket\fP. Added in 7.53.0. |
| 229 | .IP "\-\-alt-svc <file name>" |
| 230 | (HTTPS) This option enables the alt-svc parser in curl. If the file name points to an |
| 231 | existing alt-svc cache file, that will be used. After a completed transfer, |
| 232 | the cache will be saved to the file name again if it has been modified. |
| 233 | |
| 234 | Specify a "" file name (zero length) to avoid loading/saving and make curl |
| 235 | just handle the cache in memory. |
| 236 | |
| 237 | If this option is used several times, curl will load contents from all the |
| 238 | files but the last one will be used for saving. |
| 239 | |
| 240 | --alt-svc can be used several times in a command line |
| 241 | |
| 242 | Example: |
| 243 | .nf |
| 244 | curl --alt-svc svc.txt https://example.com |
| 245 | .fi |
| 246 | |
| 247 | See also \fI--resolve\fP and \fI--connect-to\fP. Added in 7.64.1. |
| 248 | .IP "\-\-anyauth" |
| 249 | (HTTP) Tells curl to figure out authentication method by itself, and use the most |
| 250 | secure one the remote site claims to support. This is done by first doing a |
| 251 | request and checking the response-headers, thus possibly inducing an extra |
| 252 | network round-trip. This is used instead of setting a specific authentication |
| 253 | method, which you can do with \fI\-\-basic\fP, \fI\-\-digest\fP, \fI\-\-ntlm\fP, and \fI\-\-negotiate\fP. |
| 254 | |
| 255 | Using \-\-anyauth is not recommended if you do uploads from stdin, since it may |
| 256 | require data to be sent twice and then the client must be able to rewind. If |
| 257 | the need should arise when uploading from stdin, the upload operation will |
| 258 | fail. |
| 259 | |
| 260 | Used together with \fI\-u, \-\-user\fP. |
| 261 | |
| 262 | Providing --anyauth multiple times has no extra effect. |
| 263 | |
| 264 | Example: |
| 265 | .nf |
| 266 | curl --anyauth --user me:pwd https://example.com |
| 267 | .fi |
| 268 | |
| 269 | See also \fI--proxy-anyauth\fP, \fI--basic\fP and \fI--digest\fP. |
| 270 | .IP "\-a, \-\-append" |
| 271 | (FTP SFTP) When used in an upload, this makes curl append to the target file instead of |
| 272 | overwriting it. If the remote file does not exist, it will be created. Note |
| 273 | that this flag is ignored by some SFTP servers (including OpenSSH). |
| 274 | |
| 275 | Providing --append multiple times has no extra effect. |
| 276 | Disable it again with --no-append. |
| 277 | |
| 278 | Example: |
| 279 | .nf |
| 280 | curl --upload-file local --append ftp://example.com/ |
| 281 | .fi |
| 282 | |
| 283 | See also \fI-r, --range\fP and \fI-C, --continue-at\fP. |
| 284 | .IP "\-\-aws-sigv4 <provider1[:provider2[:region[:service]]]>" |
| 285 | Use AWS V4 signature authentication in the transfer. |
| 286 | |
| 287 | The provider argument is a string that is used by the algorithm when creating |
| 288 | outgoing authentication headers. |
| 289 | |
| 290 | The region argument is a string that points to a geographic area of |
| 291 | a resources collection (region-code) when the region name is omitted from |
| 292 | the endpoint. |
| 293 | |
| 294 | The service argument is a string that points to a function provided by a cloud |
| 295 | (service-code) when the service name is omitted from the endpoint. |
| 296 | |
| 297 | If --aws-sigv4 is provided several times, the last set value will be used. |
| 298 | |
| 299 | Example: |
| 300 | .nf |
| 301 | curl --aws-sigv4 "aws:amz:east-2:es" --user "key:secret" https://example.com |
| 302 | .fi |
| 303 | |
| 304 | See also \fI--basic\fP and \fI-u, --user\fP. Added in 7.75.0. |
| 305 | .IP "\-\-basic" |
| 306 | (HTTP) Tells curl to use HTTP Basic authentication with the remote host. This is the |
| 307 | default and this option is usually pointless, unless you use it to override a |
| 308 | previously set option that sets a different authentication method (such as |
| 309 | \fI\-\-ntlm\fP, \fI\-\-digest\fP, or \fI\-\-negotiate\fP). |
| 310 | |
| 311 | Used together with \fI\-u, \-\-user\fP. |
| 312 | |
| 313 | Providing --basic multiple times has no extra effect. |
| 314 | |
| 315 | Example: |
| 316 | .nf |
| 317 | curl -u name:password --basic https://example.com |
| 318 | .fi |
| 319 | |
| 320 | See also \fI--proxy-basic\fP. |
| 321 | .IP "\-\-cacert <file>" |
| 322 | (TLS) Tells curl to use the specified certificate file to verify the peer. The file |
| 323 | may contain multiple CA certificates. The certificate(s) must be in PEM |
| 324 | format. Normally curl is built to use a default file for this, so this option |
| 325 | is typically used to alter that default file. |
| 326 | |
| 327 | curl recognizes the environment variable named 'CURL_CA_BUNDLE' if it is |
| 328 | set, and uses the given path as a path to a CA cert bundle. This option |
| 329 | overrides that variable. |
| 330 | |
| 331 | The windows version of curl will automatically look for a CA certs file named |
| 332 | \(aqcurl-ca-bundle.crt', either in the same directory as curl.exe, or in the |
| 333 | Current Working Directory, or in any folder along your PATH. |
| 334 | |
| 335 | If curl is built against the NSS SSL library, the NSS PEM PKCS#11 module |
| 336 | (libnsspem.so) needs to be available for this option to work properly. |
| 337 | |
| 338 | (iOS and macOS only) If curl is built against Secure Transport, then this |
| 339 | option is supported for backward compatibility with other SSL engines, but it |
| 340 | should not be set. If the option is not set, then curl will use the |
| 341 | certificates in the system and user Keychain to verify the peer, which is the |
| 342 | preferred method of verifying the peer's certificate chain. |
| 343 | |
| 344 | (Schannel only) This option is supported for Schannel in Windows 7 or later |
| 345 | with libcurl 7.60 or later. This option is supported for backward |
| 346 | compatibility with other SSL engines; instead it is recommended to use |
| 347 | Windows' store of root certificates (the default for Schannel). |
| 348 | |
| 349 | If --cacert is provided several times, the last set value will be used. |
| 350 | |
| 351 | Example: |
| 352 | .nf |
| 353 | curl --cacert CA-file.txt https://example.com |
| 354 | .fi |
| 355 | |
| 356 | See also \fI--capath\fP and \fI-k, --insecure\fP. |
| 357 | .IP "\-\-capath <dir>" |
| 358 | (TLS) Tells curl to use the specified certificate directory to verify the |
| 359 | peer. Multiple paths can be provided by separating them with ":" (e.g. |
| 360 | \(dqpath1:path2:path3"). The certificates must be in PEM format, and if curl is |
| 361 | built against OpenSSL, the directory must have been processed using the |
| 362 | c_rehash utility supplied with OpenSSL. Using \-\-capath can allow |
| 363 | OpenSSL-powered curl to make SSL-connections much more efficiently than using |
| 364 | \-\-cacert if the \-\-cacert file contains many CA certificates. |
| 365 | |
| 366 | If this option is set, the default capath value will be ignored. |
| 367 | |
| 368 | If --capath is provided several times, the last set value will be used. |
| 369 | |
| 370 | Example: |
| 371 | .nf |
| 372 | curl --capath /local/directory https://example.com |
| 373 | .fi |
| 374 | |
| 375 | See also \fI--cacert\fP and \fI-k, --insecure\fP. |
| 376 | .IP "\-\-cert-status" |
| 377 | (TLS) Tells curl to verify the status of the server certificate by using the |
| 378 | Certificate Status Request (aka. OCSP stapling) TLS extension. |
| 379 | |
| 380 | If this option is enabled and the server sends an invalid (e.g. expired) |
| 381 | response, if the response suggests that the server certificate has been |
| 382 | revoked, or no response at all is received, the verification fails. |
| 383 | |
| 384 | This is currently only implemented in the OpenSSL, GnuTLS and NSS backends. |
| 385 | |
| 386 | Providing --cert-status multiple times has no extra effect. |
| 387 | Disable it again with --no-cert-status. |
| 388 | |
| 389 | Example: |
| 390 | .nf |
| 391 | curl --cert-status https://example.com |
| 392 | .fi |
| 393 | |
| 394 | See also \fI--pinnedpubkey\fP. Added in 7.41.0. |
| 395 | .IP "\-\-cert-type <type>" |
| 396 | (TLS) Tells curl what type the provided client certificate is using. PEM, DER, ENG |
| 397 | and P12 are recognized types. |
| 398 | |
| 399 | The default type depends on the TLS backend and is usually PEM, however for |
| 400 | Secure Transport and Schannel it is P12. If \-\-cert is a pkcs11: URI then ENG is |
| 401 | the default type. |
| 402 | |
| 403 | If --cert-type is provided several times, the last set value will be used. |
| 404 | |
| 405 | Example: |
| 406 | .nf |
| 407 | curl --cert-type PEM --cert file https://example.com |
| 408 | .fi |
| 409 | |
| 410 | See also \fI-E, --cert\fP, \fI--key\fP and \fI--key-type\fP. |
| 411 | .IP "\-E, \-\-cert <certificate[:password]>" |
| 412 | (TLS) Tells curl to use the specified client certificate file when getting a file |
| 413 | with HTTPS, FTPS or another SSL-based protocol. The certificate must be in |
| 414 | PKCS#12 format if using Secure Transport, or PEM format if using any other |
| 415 | engine. If the optional password is not specified, it will be queried for on |
| 416 | the terminal. Note that this option assumes a certificate file that is the |
| 417 | private key and the client certificate concatenated. See \-\-cert and \-\-key to |
| 418 | specify them independently. |
| 419 | |
| 420 | In the <certificate> portion of the argument, you must escape the character ":" |
| 421 | as "\\:" so that it is not recognized as the password delimiter. Similarly, you |
| 422 | must escape the character "\\" as "\\\\" so that it is not recognized as an |
| 423 | escape character. |
| 424 | |
| 425 | If curl is built against the NSS SSL library then this option can tell |
| 426 | curl the nickname of the certificate to use within the NSS database defined |
| 427 | by the environment variable SSL_DIR (or by default /etc/pki/nssdb). If the |
| 428 | NSS PEM PKCS#11 module (libnsspem.so) is available then PEM files may be |
| 429 | loaded. |
| 430 | |
| 431 | If you provide a path relative to the current directory, you must prefix the |
| 432 | path with "./" in order to avoid confusion with an NSS database nickname. |
| 433 | |
| 434 | If curl is built against OpenSSL library, and the engine pkcs11 is available, |
| 435 | then a PKCS#11 URI (RFC 7512) can be used to specify a certificate located in |
| 436 | a PKCS#11 device. A string beginning with "pkcs11:" will be interpreted as a |
| 437 | PKCS#11 URI. If a PKCS#11 URI is provided, then the \-\-engine option will be set |
| 438 | as "pkcs11" if none was provided and the \-\-cert-type option will be set as |
| 439 | \(dqENG" if none was provided. |
| 440 | |
| 441 | (iOS and macOS only) If curl is built against Secure Transport, then the |
| 442 | certificate string can either be the name of a certificate/private key in the |
| 443 | system or user keychain, or the path to a PKCS#12-encoded certificate and |
| 444 | private key. If you want to use a file from the current directory, please |
| 445 | precede it with "./" prefix, in order to avoid confusion with a nickname. |
| 446 | |
| 447 | (Schannel only) Client certificates must be specified by a path |
| 448 | expression to a certificate store. (Loading PFX is not supported; you can |
| 449 | import it to a store first). You can use |
| 450 | \(dq<store location>\\<store name>\\<thumbprint>" to refer to a certificate |
| 451 | in the system certificates store, for example, |
| 452 | \(dqCurrentUser\\MY\\934a7ac6f8a5d579285a74fa61e19f23ddfe8d7a". Thumbprint is |
| 453 | usually a SHA-1 hex string which you can see in certificate details. Following |
| 454 | store locations are supported: CurrentUser, LocalMachine, CurrentService, |
| 455 | Services, CurrentUserGroupPolicy, LocalMachineGroupPolicy, |
| 456 | LocalMachineEnterprise. |
| 457 | |
| 458 | If --cert is provided several times, the last set value will be used. |
| 459 | |
| 460 | Example: |
| 461 | .nf |
| 462 | curl --cert certfile --key keyfile https://example.com |
| 463 | .fi |
| 464 | |
| 465 | See also \fI--cert-type\fP, \fI--key\fP and \fI--key-type\fP. |
| 466 | .IP "\-\-ciphers <list of ciphers>" |
| 467 | (TLS) Specifies which ciphers to use in the connection. The list of ciphers must |
| 468 | specify valid ciphers. Read up on SSL cipher list details on this URL: |
| 469 | |
| 470 | .nf |
| 471 | https://curl.se/docs/ssl-ciphers.html |
| 472 | .fi |
| 473 | |
| 474 | If --ciphers is provided several times, the last set value will be used. |
| 475 | |
| 476 | Example: |
| 477 | .nf |
| 478 | curl --ciphers ECDHE-ECDSA-AES256-CCM8 https://example.com |
| 479 | .fi |
| 480 | |
| 481 | See also \fI--tlsv1.3\fP. |
| 482 | .IP "\-\-compressed-ssh" |
| 483 | (SCP SFTP) Enables built-in SSH compression. |
| 484 | This is a request, not an order; the server may or may not do it. |
| 485 | |
| 486 | Providing --compressed-ssh multiple times has no extra effect. |
| 487 | Disable it again with --no-compressed-ssh. |
| 488 | |
| 489 | Example: |
| 490 | .nf |
| 491 | curl --compressed-ssh sftp://example.com/ |
| 492 | .fi |
| 493 | |
| 494 | See also \fI--compressed\fP. Added in 7.56.0. |
| 495 | .IP "\-\-compressed" |
| 496 | (HTTP) Request a compressed response using one of the algorithms curl supports, and |
| 497 | automatically decompress the content. Headers are not modified. |
| 498 | |
| 499 | If this option is used and the server sends an unsupported encoding, curl will |
| 500 | report an error. This is a request, not an order; the server may or may not |
| 501 | deliver data compressed. |
| 502 | |
| 503 | Providing --compressed multiple times has no extra effect. |
| 504 | Disable it again with --no-compressed. |
| 505 | |
| 506 | Example: |
| 507 | .nf |
| 508 | curl --compressed https://example.com |
| 509 | .fi |
| 510 | |
| 511 | See also \fI--compressed-ssh\fP. |
| 512 | .IP "\-K, \-\-config <file>" |
| 513 | Specify a text file to read curl arguments from. The command line arguments |
| 514 | found in the text file will be used as if they were provided on the command |
| 515 | line. |
| 516 | |
| 517 | Options and their parameters must be specified on the same line in the file, |
| 518 | separated by whitespace, colon, or the equals sign. Long option names can |
| 519 | optionally be given in the config file without the initial double dashes and |
| 520 | if so, the colon or equals characters can be used as separators. If the option |
| 521 | is specified with one or two dashes, there can be no colon or equals character |
| 522 | between the option and its parameter. |
| 523 | |
| 524 | If the parameter contains whitespace (or starts with : or =), the parameter |
| 525 | must be enclosed within quotes. Within double quotes, the following escape |
| 526 | sequences are available: \\\\, \\", \\t, \\n, \\r and \\v. A backslash |
| 527 | preceding any other letter is ignored. |
| 528 | |
| 529 | If the first column of a config line is a '#' character, the rest of the line |
| 530 | will be treated as a comment. |
| 531 | |
| 532 | Only write one option per physical line in the config file. |
| 533 | |
| 534 | Specify the filename to \-\-config as '-' to make curl read the file from stdin. |
| 535 | |
| 536 | Note that to be able to specify a URL in the config file, you need to specify |
| 537 | it using the \-\-url option, and not by simply writing the URL on its own |
| 538 | line. So, it could look similar to this: |
| 539 | |
| 540 | url = "https://curl.se/docs/" |
| 541 | |
| 542 | .nf |
| 543 | # \-\-\- Example file \-\-\- |
| 544 | # this is a comment |
| 545 | url = "example.com" |
| 546 | output = "curlhere.html" |
| 547 | user-agent = "superagent/1.0" |
| 548 | .fi |
| 549 | |
| 550 | .nf |
| 551 | # and fetch another URL too |
| 552 | url = "example.com/docs/manpage.html" |
| 553 | \-O |
| 554 | referer = "http://nowhereatall.example.com/" |
| 555 | # \-\-\- End of example file \-\-\- |
| 556 | .fi |
| 557 | |
| 558 | When curl is invoked, it (unless \-\-disable is used) checks for a default |
| 559 | config file and uses it if found, even when \-\-config is used. The default |
| 560 | config file is checked for in the following places in this order: |
| 561 | |
| 562 | 1) "$CURL_HOME/.curlrc" |
| 563 | |
| 564 | 2) "$XDG_CONFIG_HOME/.curlrc" (Added in 7.73.0) |
| 565 | |
| 566 | 3) "$HOME/.curlrc" |
| 567 | |
| 568 | 4) Windows: "%USERPROFILE%\\.curlrc" |
| 569 | |
| 570 | 5) Windows: "%APPDATA%\\.curlrc" |
| 571 | |
| 572 | 6) Windows: "%USERPROFILE%\\Application Data\\.curlrc" |
| 573 | |
| 574 | 7) Non-Windows: use getpwuid to find the home directory |
| 575 | |
| 576 | 8) On Windows, if it finds no .curlrc file in the sequence described above, it |
| 577 | checks for one in the same dir the curl executable is placed. |
| 578 | |
| 579 | On Windows two filenames are checked per location: .curlrc and _curlrc, |
| 580 | preferring the former. Older versions on Windows checked for _curlrc only. |
| 581 | |
| 582 | --config can be used several times in a command line |
| 583 | |
| 584 | Example: |
| 585 | .nf |
| 586 | curl --config file.txt https://example.com |
| 587 | .fi |
| 588 | |
| 589 | See also \fI-q, --disable\fP. |
| 590 | .IP "\-\-connect-timeout <fractional seconds>" |
| 591 | Maximum time in seconds that you allow curl's connection to take. This only |
| 592 | limits the connection phase, so if curl connects within the given period it |
| 593 | will continue \- if not it will exit. Since version 7.32.0, this option |
| 594 | accepts decimal values. |
| 595 | |
| 596 | If --connect-timeout is provided several times, the last set value will be used. |
| 597 | |
| 598 | Examples: |
| 599 | .nf |
| 600 | curl --connect-timeout 20 https://example.com |
| 601 | curl --connect-timeout 3.14 https://example.com |
| 602 | .fi |
| 603 | |
| 604 | See also \fI-m, --max-time\fP. |
| 605 | .IP "\-\-connect-to <HOST1:PORT1:HOST2:PORT2>" |
| 606 | |
| 607 | For a request to the given HOST1:PORT1 pair, connect to HOST2:PORT2 instead. |
| 608 | This option is suitable to direct requests at a specific server, e.g. at a |
| 609 | specific cluster node in a cluster of servers. This option is only used to |
| 610 | establish the network connection. It does NOT affect the hostname/port that is |
| 611 | used for TLS/SSL (e.g. SNI, certificate verification) or for the application |
| 612 | protocols. "HOST1" and "PORT1" may be the empty string, meaning "any |
| 613 | host/port". "HOST2" and "PORT2" may also be the empty string, meaning "use the |
| 614 | request's original host/port". |
| 615 | |
| 616 | A "host" specified to this option is compared as a string, so it needs to |
| 617 | match the name used in request URL. It can be either numerical such as |
| 618 | \(dq127.0.0.1" or the full host name such as "example.org". |
| 619 | |
| 620 | --connect-to can be used several times in a command line |
| 621 | |
| 622 | Example: |
| 623 | .nf |
| 624 | curl --connect-to example.com:443:example.net:8443 https://example.com |
| 625 | .fi |
| 626 | |
| 627 | See also \fI--resolve\fP and \fI-H, --header\fP. Added in 7.49.0. |
| 628 | .IP "\-C, \-\-continue-at <offset>" |
| 629 | Continue/Resume a previous file transfer at the given offset. The given offset |
| 630 | is the exact number of bytes that will be skipped, counting from the beginning |
| 631 | of the source file before it is transferred to the destination. If used with |
| 632 | uploads, the FTP server command SIZE will not be used by curl. |
| 633 | |
| 634 | Use "-C \-" to tell curl to automatically find out where/how to resume the |
| 635 | transfer. It then uses the given output/input files to figure that out. |
| 636 | |
| 637 | If --continue-at is provided several times, the last set value will be used. |
| 638 | |
| 639 | Examples: |
| 640 | .nf |
| 641 | curl -C - https://example.com |
| 642 | curl -C 400 https://example.com |
| 643 | .fi |
| 644 | |
| 645 | See also \fI-r, --range\fP. |
| 646 | .IP "\-c, \-\-cookie-jar <filename>" |
| 647 | (HTTP) Specify to which file you want curl to write all cookies after a completed |
| 648 | operation. Curl writes all cookies from its in-memory cookie storage to the |
| 649 | given file at the end of operations. If no cookies are known, no data will be |
| 650 | written. The file will be written using the Netscape cookie file format. If |
| 651 | you set the file name to a single dash, "-", the cookies will be written to |
| 652 | stdout. |
| 653 | |
| 654 | This command line option will activate the cookie engine that makes curl |
| 655 | record and use cookies. Another way to activate it is to use the \-\-cookie |
| 656 | option. |
| 657 | |
| 658 | If the cookie jar cannot be created or written to, the whole curl operation |
| 659 | will not fail or even report an error clearly. Using \-\-verbose will get a |
| 660 | warning displayed, but that is the only visible feedback you get about this |
| 661 | possibly lethal situation. |
| 662 | |
| 663 | If --cookie-jar is provided several times, the last set value will be used. |
| 664 | |
| 665 | Examples: |
| 666 | .nf |
| 667 | curl -c store-here.txt https://example.com |
| 668 | curl -c store-here.txt -b read-these https://example.com |
| 669 | .fi |
| 670 | |
| 671 | See also \fI-b, --cookie\fP. |
| 672 | .IP "\-b, \-\-cookie <data|filename>" |
| 673 | (HTTP) Pass the data to the HTTP server in the Cookie header. It is supposedly the |
| 674 | data previously received from the server in a "Set-Cookie:" line. The data |
| 675 | should be in the format "NAME1=VALUE1; NAME2=VALUE2". This makes curl use the |
| 676 | cookie header with this content explicitly in all outgoing request(s). If |
| 677 | multiple requests are done due to authentication, followed redirects or |
| 678 | similar, they will all get this cookie passed on. |
| 679 | |
| 680 | If no '=' symbol is used in the argument, it is instead treated as a filename |
| 681 | to read previously stored cookie from. This option also activates the cookie |
| 682 | engine which will make curl record incoming cookies, which may be handy if |
| 683 | you are using this in combination with the \-\-location option or do multiple URL |
| 684 | transfers on the same invoke. If the file name is exactly a minus ("-"), curl |
| 685 | will instead read the contents from stdin. |
| 686 | |
| 687 | The file format of the file to read cookies from should be plain HTTP headers |
| 688 | (Set-Cookie style) or the Netscape/Mozilla cookie file format. |
| 689 | |
| 690 | The file specified with \-\-cookie is only used as input. No cookies will be |
| 691 | written to the file. To store cookies, use the \-\-cookie-jar option. |
| 692 | |
| 693 | If you use the Set-Cookie file format and do not specify a domain then the |
| 694 | cookie is not sent since the domain will never match. To address this, set a |
| 695 | domain in Set-Cookie line (doing that will include sub-domains) or preferably: |
| 696 | use the Netscape format. |
| 697 | |
| 698 | Users often want to both read cookies from a file and write updated cookies |
| 699 | back to a file, so using both \-\-cookie and \-\-cookie-jar in the same command |
| 700 | line is common. |
| 701 | |
| 702 | --cookie can be used several times in a command line |
| 703 | |
| 704 | Examples: |
| 705 | .nf |
| 706 | curl -b cookiefile https://example.com |
| 707 | curl -b cookiefile -c cookiefile https://example.com |
| 708 | .fi |
| 709 | |
| 710 | See also \fI-c, --cookie-jar\fP and \fI-j, --junk-session-cookies\fP. |
| 711 | .IP "\-\-create-dirs" |
| 712 | When used in conjunction with the \-\-output option, curl will create the |
| 713 | necessary local directory hierarchy as needed. This option creates the |
| 714 | directories mentioned with the \-\-output option, nothing else. If the \-\-output |
| 715 | file name uses no directory, or if the directories it mentions already exist, |
| 716 | no directories will be created. |
| 717 | |
| 718 | Created dirs are made with mode 0750 on unix style file systems. |
| 719 | |
| 720 | To create remote directories when using FTP or SFTP, try \fI\-\-ftp-create-dirs\fP. |
| 721 | |
| 722 | Providing --create-dirs multiple times has no extra effect. |
| 723 | Disable it again with --no-create-dirs. |
| 724 | |
| 725 | Example: |
| 726 | .nf |
| 727 | curl --create-dirs --output local/dir/file https://example.com |
| 728 | .fi |
| 729 | |
| 730 | See also \fI--ftp-create-dirs\fP and \fI--output-dir\fP. |
| 731 | .IP "\-\-create-file-mode <mode>" |
| 732 | (SFTP SCP FILE) When curl is used to create files remotely using one of the supported |
| 733 | protocols, this option allows the user to set which 'mode' to set on the file |
| 734 | at creation time, instead of the default 0644. |
| 735 | |
| 736 | This option takes an octal number as argument. |
| 737 | |
| 738 | If --create-file-mode is provided several times, the last set value will be used. |
| 739 | |
| 740 | Example: |
| 741 | .nf |
| 742 | curl --create-file-mode 0777 -T localfile sftp://example.com/new |
| 743 | .fi |
| 744 | |
| 745 | See also \fI--ftp-create-dirs\fP. Added in 7.75.0. |
| 746 | .IP "\-\-crlf" |
| 747 | (FTP SMTP) Convert LF to CRLF in upload. Useful for MVS (OS/390). |
| 748 | |
| 749 | (SMTP added in 7.40.0) |
| 750 | |
| 751 | Providing --crlf multiple times has no extra effect. |
| 752 | Disable it again with --no-crlf. |
| 753 | |
| 754 | Example: |
| 755 | .nf |
| 756 | curl --crlf -T file ftp://example.com/ |
| 757 | .fi |
| 758 | |
| 759 | See also \fI-B, --use-ascii\fP. |
| 760 | .IP "\-\-crlfile <file>" |
| 761 | (TLS) Provide a file using PEM format with a Certificate Revocation List that may |
| 762 | specify peer certificates that are to be considered revoked. |
| 763 | |
| 764 | If --crlfile is provided several times, the last set value will be used. |
| 765 | |
| 766 | Example: |
| 767 | .nf |
| 768 | curl --crlfile rejects.txt https://example.com |
| 769 | .fi |
| 770 | |
| 771 | See also \fI--cacert\fP and \fI--capath\fP. |
| 772 | .IP "\-\-curves <algorithm list>" |
| 773 | (TLS) Tells curl to request specific curves to use during SSL session establishment |
| 774 | according to RFC 8422, 5.1. Multiple algorithms can be provided by separating |
| 775 | them with ":" (e.g. "X25519:P-521"). The parameter is available identically |
| 776 | in the "openssl s_client/s_server" utilities. |
| 777 | |
| 778 | \-\-curves allows a OpenSSL powered curl to make SSL-connections with exactly |
| 779 | the (EC) curve requested by the client, avoiding nontransparent client/server |
| 780 | negotiations. |
| 781 | |
| 782 | If this option is set, the default curves list built into openssl will be |
| 783 | ignored. |
| 784 | |
| 785 | If --curves is provided several times, the last set value will be used. |
| 786 | |
| 787 | Example: |
| 788 | .nf |
| 789 | curl --curves X25519 https://example.com |
| 790 | .fi |
| 791 | |
| 792 | See also \fI--ciphers\fP. Added in 7.73.0. |
| 793 | .IP "\-\-data-ascii <data>" |
| 794 | (HTTP) This is just an alias for \fI\-d, \-\-data\fP. |
| 795 | |
| 796 | --data-ascii can be used several times in a command line |
| 797 | |
| 798 | Example: |
| 799 | .nf |
| 800 | curl --data-ascii @file https://example.com |
| 801 | .fi |
| 802 | |
| 803 | See also \fI--data-binary\fP, \fI--data-raw\fP and \fI--data-urlencode\fP. |
| 804 | .IP "\-\-data-binary <data>" |
| 805 | (HTTP) This posts data exactly as specified with no extra processing whatsoever. |
| 806 | |
| 807 | If you start the data with the letter @, the rest should be a filename. Data |
| 808 | is posted in a similar manner as \-\-data does, except that newlines and |
| 809 | carriage returns are preserved and conversions are never done. |
| 810 | |
| 811 | Like \-\-data the default content-type sent to the server is |
| 812 | application/x-www-form-urlencoded. If you want the data to be treated as |
| 813 | arbitrary binary data by the server then set the content-type to octet-stream: |
| 814 | \-H "Content-Type: application/octet-stream". |
| 815 | |
| 816 | If this option is used several times, the ones following the first will append |
| 817 | data as described in \fI\-d, \-\-data\fP. |
| 818 | |
| 819 | --data-binary can be used several times in a command line |
| 820 | |
| 821 | Example: |
| 822 | .nf |
| 823 | curl --data-binary @filename https://example.com |
| 824 | .fi |
| 825 | |
| 826 | See also \fI--data-ascii\fP. |
| 827 | .IP "\-\-data-raw <data>" |
| 828 | (HTTP) This posts data similarly to \-\-data but without the special |
| 829 | interpretation of the @ character. |
| 830 | |
| 831 | --data-raw can be used several times in a command line |
| 832 | |
| 833 | Examples: |
| 834 | .nf |
| 835 | curl --data-raw "hello" https://example.com |
| 836 | curl --data-raw "@at@at@" https://example.com |
| 837 | .fi |
| 838 | |
| 839 | See also \fI-d, --data\fP. Added in 7.43.0. |
| 840 | .IP "\-\-data-urlencode <data>" |
| 841 | (HTTP) This posts data, similar to the other \-\-data options with the exception |
| 842 | that this performs URL-encoding. |
| 843 | |
| 844 | To be CGI-compliant, the <data> part should begin with a \fIname\fP followed |
| 845 | by a separator and a content specification. The <data> part can be passed to |
| 846 | curl using one of the following syntaxes: |
| 847 | .RS |
| 848 | .IP "content" |
| 849 | This will make curl URL-encode the content and pass that on. Just be careful |
| 850 | so that the content does not contain any = or @ symbols, as that will then make |
| 851 | the syntax match one of the other cases below! |
| 852 | .IP "=content" |
| 853 | This will make curl URL-encode the content and pass that on. The preceding = |
| 854 | symbol is not included in the data. |
| 855 | .IP "name=content" |
| 856 | This will make curl URL-encode the content part and pass that on. Note that |
| 857 | the name part is expected to be URL-encoded already. |
| 858 | .IP "@filename" |
| 859 | This will make curl load data from the given file (including any newlines), |
| 860 | URL-encode that data and pass it on in the POST. |
| 861 | .IP "name@filename" |
| 862 | This will make curl load data from the given file (including any newlines), |
| 863 | URL-encode that data and pass it on in the POST. The name part gets an equal |
| 864 | sign appended, resulting in \fIname=urlencoded-file-content\fP. Note that the |
| 865 | name is expected to be URL-encoded already. |
| 866 | .RE |
| 867 | |
| 868 | --data-urlencode can be used several times in a command line |
| 869 | |
| 870 | Examples: |
| 871 | .nf |
| 872 | curl --data-urlencode name=val https://example.com |
| 873 | curl --data-urlencode =encodethis https://example.com |
| 874 | curl --data-urlencode name@file https://example.com |
| 875 | curl --data-urlencode @fileonly https://example.com |
| 876 | .fi |
| 877 | |
| 878 | See also \fI-d, --data\fP and \fI--data-raw\fP. |
| 879 | .IP "\-d, \-\-data <data>" |
| 880 | (HTTP MQTT) Sends the specified data in a POST request to the HTTP server, in the same way |
| 881 | that a browser does when a user has filled in an HTML form and presses the |
| 882 | submit button. This will cause curl to pass the data to the server using the |
| 883 | content-type application/x-www-form-urlencoded. Compare to \fI\-F, \-\-form\fP. |
| 884 | |
| 885 | \-\-data-raw is almost the same but does not have a special interpretation of |
| 886 | the @ character. To post data purely binary, you should instead use the |
| 887 | \-\-data-binary option. To URL-encode the value of a form field you may use |
| 888 | \fI\-\-data-urlencode\fP. |
| 889 | |
| 890 | If any of these options is used more than once on the same command line, the |
| 891 | data pieces specified will be merged with a separating &-symbol. Thus, using |
| 892 | \(aq-d name=daniel \-d skill=lousy' would generate a post chunk that looks like |
| 893 | \(aqname=daniel&skill=lousy'. |
| 894 | |
| 895 | If you start the data with the letter @, the rest should be a file name to |
| 896 | read the data from, or \- if you want curl to read the data from stdin. Posting |
| 897 | data from a file named 'foobar' would thus be done with \fI\-d, \-\-data\fP @foobar. When |
| 898 | \-\-data is told to read from a file like that, carriage returns and newlines |
| 899 | will be stripped out. If you do not want the @ character to have a special |
| 900 | interpretation use \-\-data-raw instead. |
| 901 | |
| 902 | --data can be used several times in a command line |
| 903 | |
| 904 | Examples: |
| 905 | .nf |
| 906 | curl -d "name=curl" https://example.com |
| 907 | curl -d "name=curl" -d "tool=cmdline" https://example.com |
| 908 | curl -d @filename https://example.com |
| 909 | .fi |
| 910 | |
| 911 | See also \fI--data-binary\fP, \fI--data-urlencode\fP and \fI--data-raw\fP. This option is mutually exclusive to \fI-F, --form\fP and \fI-I, --head\fP and \fI-T, --upload-file\fP. |
| 912 | .IP "\-\-delegation <LEVEL>" |
| 913 | (GSS/kerberos) Set LEVEL to tell the server what it is allowed to delegate when it |
| 914 | comes to user credentials. |
| 915 | .RS |
| 916 | .IP "none" |
| 917 | Do not allow any delegation. |
| 918 | .IP "policy" |
| 919 | Delegates if and only if the OK-AS-DELEGATE flag is set in the Kerberos |
| 920 | service ticket, which is a matter of realm policy. |
| 921 | .IP "always" |
| 922 | Unconditionally allow the server to delegate. |
| 923 | .RE |
| 924 | |
| 925 | If --delegation is provided several times, the last set value will be used. |
| 926 | |
| 927 | Example: |
| 928 | .nf |
| 929 | curl --delegation "none" https://example.com |
| 930 | .fi |
| 931 | |
| 932 | See also \fI-k, --insecure\fP and \fI--ssl\fP. |
| 933 | .IP "\-\-digest" |
| 934 | (HTTP) Enables HTTP Digest authentication. This is an authentication scheme that |
| 935 | prevents the password from being sent over the wire in clear text. Use this in |
| 936 | combination with the normal \-\-user option to set user name and password. |
| 937 | |
| 938 | Providing --digest multiple times has no extra effect. |
| 939 | Disable it again with --no-digest. |
| 940 | |
| 941 | Example: |
| 942 | .nf |
| 943 | curl -u name:password --digest https://example.com |
| 944 | .fi |
| 945 | |
| 946 | See also \fI-u, --user\fP, \fI--proxy-digest\fP and \fI--anyauth\fP. This option is mutually exclusive to \fI--basic\fP and \fI--ntlm\fP and \fI--negotiate\fP. |
| 947 | .IP "\-\-disable-eprt" |
| 948 | (FTP) Tell curl to disable the use of the EPRT and LPRT commands when doing active |
| 949 | FTP transfers. Curl will normally always first attempt to use EPRT, then LPRT |
| 950 | before using PORT, but with this option, it will use PORT right away. EPRT and |
| 951 | LPRT are extensions to the original FTP protocol, and may not work on all |
| 952 | servers, but they enable more functionality in a better way than the |
| 953 | traditional PORT command. |
| 954 | |
| 955 | \-\-eprt can be used to explicitly enable EPRT again and \-\-no-eprt is an alias |
| 956 | for \fI\-\-disable-eprt\fP. |
| 957 | |
| 958 | If the server is accessed using IPv6, this option will have no effect as EPRT |
| 959 | is necessary then. |
| 960 | |
| 961 | Disabling EPRT only changes the active behavior. If you want to switch to |
| 962 | passive mode you need to not use \-\-ftp-port or force it with \fI\-\-ftp-pasv\fP. |
| 963 | |
| 964 | Providing --disable-eprt multiple times has no extra effect. |
| 965 | Disable it again with --no-disable-eprt. |
| 966 | |
| 967 | Example: |
| 968 | .nf |
| 969 | curl --disable-eprt ftp://example.com/ |
| 970 | .fi |
| 971 | |
| 972 | See also \fI--disable-epsv\fP and \fI-P, --ftp-port\fP. |
| 973 | .IP "\-\-disable-epsv" |
| 974 | (FTP) Tell curl to disable the use of the EPSV command when doing passive FTP |
| 975 | transfers. Curl will normally always first attempt to use EPSV before |
| 976 | PASV, but with this option, it will not try using EPSV. |
| 977 | |
| 978 | \-\-epsv can be used to explicitly enable EPSV again and \-\-no-epsv is an alias |
| 979 | for \fI\-\-disable-epsv\fP. |
| 980 | |
| 981 | If the server is an IPv6 host, this option will have no effect as EPSV is |
| 982 | necessary then. |
| 983 | |
| 984 | Disabling EPSV only changes the passive behavior. If you want to switch to |
| 985 | active mode you need to use \fI\-P, \-\-ftp-port\fP. |
| 986 | |
| 987 | Providing --disable-epsv multiple times has no extra effect. |
| 988 | Disable it again with --no-disable-epsv. |
| 989 | |
| 990 | Example: |
| 991 | .nf |
| 992 | curl --disable-epsv ftp://example.com/ |
| 993 | .fi |
| 994 | |
| 995 | See also \fI--disable-eprt\fP and \fI-P, --ftp-port\fP. |
| 996 | .IP "\-q, \-\-disable" |
| 997 | If used as the first parameter on the command line, the \fIcurlrc\fP config |
| 998 | file will not be read and used. See the \-\-config for details on the default |
| 999 | config file search path. |
| 1000 | |
| 1001 | Providing --disable multiple times has no extra effect. |
| 1002 | Disable it again with --no-disable. |
| 1003 | |
| 1004 | Example: |
| 1005 | .nf |
| 1006 | curl -q https://example.com |
| 1007 | .fi |
| 1008 | |
| 1009 | See also \fI-K, --config\fP. |
| 1010 | .IP "\-\-disallow-username-in-url" |
| 1011 | (HTTP) This tells curl to exit if passed a URL containing a username. This is probably |
| 1012 | most useful when the URL is being provided at runtime or similar. |
| 1013 | |
| 1014 | Providing --disallow-username-in-url multiple times has no extra effect. |
| 1015 | Disable it again with --no-disallow-username-in-url. |
| 1016 | |
| 1017 | Example: |
| 1018 | .nf |
| 1019 | curl --disallow-username-in-url https://example.com |
| 1020 | .fi |
| 1021 | |
| 1022 | See also \fI--proto\fP. Added in 7.61.0. |
| 1023 | .IP "\-\-dns-interface <interface>" |
| 1024 | (DNS) Tell curl to send outgoing DNS requests through <interface>. This option is a |
| 1025 | counterpart to \fI\-\-interface\fP (which does not affect DNS). The supplied string |
| 1026 | must be an interface name (not an address). |
| 1027 | |
| 1028 | If --dns-interface is provided several times, the last set value will be used. |
| 1029 | |
| 1030 | Example: |
| 1031 | .nf |
| 1032 | curl --dns-interface eth0 https://example.com |
| 1033 | .fi |
| 1034 | |
| 1035 | See also \fI--dns-ipv4-addr\fP and \fI--dns-ipv6-addr\fP. \fI--dns-interface\fP requires that the underlying libcurl was built to support c-ares. Added in 7.33.0. |
| 1036 | .IP "\-\-dns-ipv4-addr <address>" |
| 1037 | (DNS) Tell curl to bind to <ip-address> when making IPv4 DNS requests, so that |
| 1038 | the DNS requests originate from this address. The argument should be a |
| 1039 | single IPv4 address. |
| 1040 | |
| 1041 | If --dns-ipv4-addr is provided several times, the last set value will be used. |
| 1042 | |
| 1043 | Example: |
| 1044 | .nf |
| 1045 | curl --dns-ipv4-addr 10.1.2.3 https://example.com |
| 1046 | .fi |
| 1047 | |
| 1048 | See also \fI--dns-interface\fP and \fI--dns-ipv6-addr\fP. \fI--dns-ipv4-addr\fP requires that the underlying libcurl was built to support c-ares. Added in 7.33.0. |
| 1049 | .IP "\-\-dns-ipv6-addr <address>" |
| 1050 | (DNS) Tell curl to bind to <ip-address> when making IPv6 DNS requests, so that |
| 1051 | the DNS requests originate from this address. The argument should be a |
| 1052 | single IPv6 address. |
| 1053 | |
| 1054 | If --dns-ipv6-addr is provided several times, the last set value will be used. |
| 1055 | |
| 1056 | Example: |
| 1057 | .nf |
| 1058 | curl --dns-ipv6-addr 2a04:4e42::561 https://example.com |
| 1059 | .fi |
| 1060 | |
| 1061 | See also \fI--dns-interface\fP and \fI--dns-ipv4-addr\fP. \fI--dns-ipv6-addr\fP requires that the underlying libcurl was built to support c-ares. Added in 7.33.0. |
| 1062 | .IP "\-\-dns-servers <addresses>" |
| 1063 | Set the list of DNS servers to be used instead of the system default. |
| 1064 | The list of IP addresses should be separated with commas. Port numbers |
| 1065 | may also optionally be given as \fI:<port-number>\fP after each IP |
| 1066 | address. |
| 1067 | |
| 1068 | If --dns-servers is provided several times, the last set value will be used. |
| 1069 | |
| 1070 | Example: |
| 1071 | .nf |
| 1072 | curl --dns-servers 192.168.0.1,192.168.0.2 https://example.com |
| 1073 | .fi |
| 1074 | |
| 1075 | See also \fI--dns-interface\fP and \fI--dns-ipv4-addr\fP. \fI--dns-servers\fP requires that the underlying libcurl was built to support c-ares. Added in 7.33.0. |
| 1076 | .IP "\-\-doh-cert-status" |
| 1077 | Same as \-\-cert-status but used for DoH (DNS-over-HTTPS). |
| 1078 | |
| 1079 | Providing --doh-cert-status multiple times has no extra effect. |
| 1080 | Disable it again with --no-doh-cert-status. |
| 1081 | |
| 1082 | Example: |
| 1083 | .nf |
| 1084 | curl --doh-cert-status --doh-url https://doh.example https://example.com |
| 1085 | .fi |
| 1086 | |
| 1087 | See also \fI--doh-insecure\fP. Added in 7.76.0. |
| 1088 | .IP "\-\-doh-insecure" |
| 1089 | Same as \-\-insecure but used for DoH (DNS-over-HTTPS). |
| 1090 | |
| 1091 | Providing --doh-insecure multiple times has no extra effect. |
| 1092 | Disable it again with --no-doh-insecure. |
| 1093 | |
| 1094 | Example: |
| 1095 | .nf |
| 1096 | curl --doh-insecure --doh-url https://doh.example https://example.com |
| 1097 | .fi |
| 1098 | |
| 1099 | See also \fI--doh-url\fP. Added in 7.76.0. |
| 1100 | .IP "\-\-doh-url <URL>" |
| 1101 | Specifies which DNS-over-HTTPS (DoH) server to use to resolve hostnames, |
| 1102 | instead of using the default name resolver mechanism. The URL must be HTTPS. |
| 1103 | |
| 1104 | Some SSL options that you set for your transfer will apply to DoH since the |
| 1105 | name lookups take place over SSL. However, the certificate verification |
| 1106 | settings are not inherited and can be controlled separately via |
| 1107 | \-\-doh-insecure and \fI\-\-doh-cert-status\fP. |
| 1108 | |
| 1109 | This option is unset if an empty string "" is used as the URL. (Added in |
| 1110 | 7.85.0) |
| 1111 | |
| 1112 | If --doh-url is provided several times, the last set value will be used. |
| 1113 | |
| 1114 | Example: |
| 1115 | .nf |
| 1116 | curl --doh-url https://doh.example https://example.com |
| 1117 | .fi |
| 1118 | |
| 1119 | See also \fI--doh-insecure\fP. Added in 7.62.0. |
| 1120 | .IP "\-D, \-\-dump-header <filename>" |
| 1121 | (HTTP FTP) Write the received protocol headers to the specified file. If no headers are |
| 1122 | received, the use of this option will create an empty file. |
| 1123 | |
| 1124 | When used in FTP, the FTP server response lines are considered being "headers" |
| 1125 | and thus are saved there. |
| 1126 | |
| 1127 | If --dump-header is provided several times, the last set value will be used. |
| 1128 | |
| 1129 | Example: |
| 1130 | .nf |
| 1131 | curl --dump-header store.txt https://example.com |
| 1132 | .fi |
| 1133 | |
| 1134 | See also \fI-o, --output\fP. |
| 1135 | .IP "\-\-egd-file <file>" |
| 1136 | (TLS) Deprecated option. This option is ignored by curl since 7.84.0. Prior to that |
| 1137 | it only had an effect on curl if built to use old versions of OpenSSL. |
| 1138 | |
| 1139 | Specify the path name to the Entropy Gathering Daemon socket. The socket is |
| 1140 | used to seed the random engine for SSL connections. |
| 1141 | |
| 1142 | If --egd-file is provided several times, the last set value will be used. |
| 1143 | |
| 1144 | Example: |
| 1145 | .nf |
| 1146 | curl --egd-file /random/here https://example.com |
| 1147 | .fi |
| 1148 | |
| 1149 | See also \fI--random-file\fP. |
| 1150 | .IP "\-\-engine <name>" |
| 1151 | (TLS) Select the OpenSSL crypto engine to use for cipher operations. Use \-\-engine |
| 1152 | list to print a list of build-time supported engines. Note that not all (and |
| 1153 | possibly none) of the engines may be available at runtime. |
| 1154 | |
| 1155 | If --engine is provided several times, the last set value will be used. |
| 1156 | |
| 1157 | Example: |
| 1158 | .nf |
| 1159 | curl --engine flavor https://example.com |
| 1160 | .fi |
| 1161 | |
| 1162 | See also \fI--ciphers\fP and \fI--curves\fP. |
| 1163 | .IP "\-\-etag-compare <file>" |
| 1164 | (HTTP) This option makes a conditional HTTP request for the specific ETag read |
| 1165 | from the given file by sending a custom If-None-Match header using the |
| 1166 | stored ETag. |
| 1167 | |
| 1168 | For correct results, make sure that the specified file contains only a |
| 1169 | single line with the desired ETag. An empty file is parsed as an empty |
| 1170 | ETag. |
| 1171 | |
| 1172 | Use the option \-\-etag-save to first save the ETag from a response, and |
| 1173 | then use this option to compare against the saved ETag in a subsequent |
| 1174 | request. |
| 1175 | |
| 1176 | If --etag-compare is provided several times, the last set value will be used. |
| 1177 | |
| 1178 | Example: |
| 1179 | .nf |
| 1180 | curl --etag-compare etag.txt https://example.com |
| 1181 | .fi |
| 1182 | |
| 1183 | See also \fI--etag-save\fP and \fI-z, --time-cond\fP. Added in 7.68.0. |
| 1184 | .IP "\-\-etag-save <file>" |
| 1185 | (HTTP) This option saves an HTTP ETag to the specified file. An ETag is a |
| 1186 | caching related header, usually returned in a response. |
| 1187 | |
| 1188 | If no ETag is sent by the server, an empty file is created. |
| 1189 | |
| 1190 | If --etag-save is provided several times, the last set value will be used. |
| 1191 | |
| 1192 | Example: |
| 1193 | .nf |
| 1194 | curl --etag-save storetag.txt https://example.com |
| 1195 | .fi |
| 1196 | |
| 1197 | See also \fI--etag-compare\fP. Added in 7.68.0. |
| 1198 | .IP "\-\-expect100-timeout <seconds>" |
| 1199 | (HTTP) Maximum time in seconds that you allow curl to wait for a 100-continue |
| 1200 | response when curl emits an Expects: 100-continue header in its request. By |
| 1201 | default curl will wait one second. This option accepts decimal values! When |
| 1202 | curl stops waiting, it will continue as if the response has been received. |
| 1203 | |
| 1204 | If --expect100-timeout is provided several times, the last set value will be used. |
| 1205 | |
| 1206 | Example: |
| 1207 | .nf |
| 1208 | curl --expect100-timeout 2.5 -T file https://example.com |
| 1209 | .fi |
| 1210 | |
| 1211 | See also \fI--connect-timeout\fP. Added in 7.47.0. |
| 1212 | .IP "\-\-fail-early" |
| 1213 | Fail and exit on the first detected transfer error. |
| 1214 | |
| 1215 | When curl is used to do multiple transfers on the command line, it will |
| 1216 | attempt to operate on each given URL, one by one. By default, it will ignore |
| 1217 | errors if there are more URLs given and the last URL's success will determine |
| 1218 | the error code curl returns. So early failures will be "hidden" by subsequent |
| 1219 | successful transfers. |
| 1220 | |
| 1221 | Using this option, curl will instead return an error on the first transfer |
| 1222 | that fails, independent of the amount of URLs that are given on the command |
| 1223 | line. This way, no transfer failures go undetected by scripts and similar. |
| 1224 | |
| 1225 | This option is global and does not need to be specified for each use of \fI\-:, \-\-next\fP. |
| 1226 | |
| 1227 | This option does not imply \fI\-f, \-\-fail\fP, which causes transfers to fail due to the |
| 1228 | server's HTTP status code. You can combine the two options, however note \-\-fail |
| 1229 | is not global and is therefore contained by \fI\-:, \-\-next\fP. |
| 1230 | |
| 1231 | Providing --fail-early multiple times has no extra effect. |
| 1232 | Disable it again with --no-fail-early. |
| 1233 | |
| 1234 | Example: |
| 1235 | .nf |
| 1236 | curl --fail-early https://example.com https://two.example |
| 1237 | .fi |
| 1238 | |
| 1239 | See also \fI-f, --fail\fP and \fI--fail-with-body\fP. Added in 7.52.0. |
| 1240 | .IP "\-\-fail-with-body" |
| 1241 | (HTTP) Return an error on server errors where the HTTP response code is 400 or |
| 1242 | greater). In normal cases when an HTTP server fails to deliver a document, it |
| 1243 | returns an HTML document stating so (which often also describes why and |
| 1244 | more). This flag will still allow curl to output and save that content but |
| 1245 | also to return error 22. |
| 1246 | |
| 1247 | This is an alternative option to \-\-fail which makes curl fail for the same |
| 1248 | circumstances but without saving the content. |
| 1249 | |
| 1250 | Providing --fail-with-body multiple times has no extra effect. |
| 1251 | Disable it again with --no-fail-with-body. |
| 1252 | |
| 1253 | Example: |
| 1254 | .nf |
| 1255 | curl --fail-with-body https://example.com |
| 1256 | .fi |
| 1257 | |
| 1258 | See also \fI-f, --fail\fP. This option is mutually exclusive to \fI-f, --fail\fP. Added in 7.76.0. |
| 1259 | .IP "\-f, \-\-fail" |
| 1260 | (HTTP) Fail fast with no output at all on server errors. This is useful to enable |
| 1261 | scripts and users to better deal with failed attempts. In normal cases when an |
| 1262 | HTTP server fails to deliver a document, it returns an HTML document stating |
| 1263 | so (which often also describes why and more). This flag will prevent curl from |
| 1264 | outputting that and return error 22. |
| 1265 | |
| 1266 | This method is not fail-safe and there are occasions where non-successful |
| 1267 | response codes will slip through, especially when authentication is involved |
| 1268 | (response codes 401 and 407). |
| 1269 | |
| 1270 | Providing --fail multiple times has no extra effect. |
| 1271 | Disable it again with --no-fail. |
| 1272 | |
| 1273 | Example: |
| 1274 | .nf |
| 1275 | curl --fail https://example.com |
| 1276 | .fi |
| 1277 | |
| 1278 | See also \fI--fail-with-body\fP. This option is mutually exclusive to \fI--fail-with-body\fP. |
| 1279 | .IP "\-\-false-start" |
| 1280 | (TLS) Tells curl to use false start during the TLS handshake. False start is a mode |
| 1281 | where a TLS client will start sending application data before verifying the |
| 1282 | server's Finished message, thus saving a round trip when performing a full |
| 1283 | handshake. |
| 1284 | |
| 1285 | This is currently only implemented in the NSS and Secure Transport (on iOS 7.0 |
| 1286 | or later, or OS X 10.9 or later) backends. |
| 1287 | |
| 1288 | Providing --false-start multiple times has no extra effect. |
| 1289 | Disable it again with --no-false-start. |
| 1290 | |
| 1291 | Example: |
| 1292 | .nf |
| 1293 | curl --false-start https://example.com |
| 1294 | .fi |
| 1295 | |
| 1296 | See also \fI--tcp-fastopen\fP. Added in 7.42.0. |
| 1297 | .IP "\-\-form-escape" |
| 1298 | (HTTP) Tells curl to pass on names of multipart form fields and files using |
| 1299 | backslash-escaping instead of percent-encoding. |
| 1300 | |
| 1301 | If --form-escape is provided several times, the last set value will be used. |
| 1302 | |
| 1303 | Example: |
| 1304 | .nf |
| 1305 | curl --form-escape -F 'field\\name=curl' -F 'file=@load"this' https://example.com |
| 1306 | .fi |
| 1307 | |
| 1308 | See also \fI-F, --form\fP. Added in 7.81.0. |
| 1309 | .IP "\-\-form-string <name=string>" |
| 1310 | (HTTP SMTP IMAP) Similar to \-\-form except that the value string for the named parameter is used |
| 1311 | literally. Leading '@' and '<' characters, and the ';type=' string in |
| 1312 | the value have no special meaning. Use this in preference to \-\-form if |
| 1313 | there's any possibility that the string value may accidentally trigger the |
| 1314 | \(aq@' or '<' features of \fI\-F, \-\-form\fP. |
| 1315 | |
| 1316 | --form-string can be used several times in a command line |
| 1317 | |
| 1318 | Example: |
| 1319 | .nf |
| 1320 | curl --form-string "data" https://example.com |
| 1321 | .fi |
| 1322 | |
| 1323 | See also \fI-F, --form\fP. |
| 1324 | .IP "\-F, \-\-form <name=content>" |
| 1325 | (HTTP SMTP IMAP) For HTTP protocol family, this lets curl emulate a filled-in form in which a |
| 1326 | user has pressed the submit button. This causes curl to POST data using the |
| 1327 | Content-Type multipart/form-data according to RFC 2388. |
| 1328 | |
| 1329 | For SMTP and IMAP protocols, this is the means to compose a multipart mail |
| 1330 | message to transmit. |
| 1331 | |
| 1332 | This enables uploading of binary files etc. To force the 'content' part to be |
| 1333 | a file, prefix the file name with an @ sign. To just get the content part from |
| 1334 | a file, prefix the file name with the symbol <. The difference between @ and < |
| 1335 | is then that @ makes a file get attached in the post as a file upload, while |
| 1336 | the < makes a text field and just get the contents for that text field from a |
| 1337 | file. |
| 1338 | |
| 1339 | Tell curl to read content from stdin instead of a file by using \- as |
| 1340 | filename. This goes for both @ and < constructs. When stdin is used, the |
| 1341 | contents is buffered in memory first by curl to determine its size and allow a |
| 1342 | possible resend. Defining a part's data from a named non-regular file (such |
| 1343 | as a named pipe or similar) is unfortunately not subject to buffering and will |
| 1344 | be effectively read at transmission time; since the full size is unknown |
| 1345 | before the transfer starts, such data is sent as chunks by HTTP and rejected |
| 1346 | by IMAP. |
| 1347 | |
| 1348 | Example: send an image to an HTTP server, where 'profile' is the name of the |
| 1349 | form-field to which the file portrait.jpg will be the input: |
| 1350 | |
| 1351 | .nf |
| 1352 | curl \-F profile=@portrait.jpg https://example.com/upload.cgi |
| 1353 | .fi |
| 1354 | |
| 1355 | Example: send your name and shoe size in two text fields to the server: |
| 1356 | |
| 1357 | .nf |
| 1358 | curl \-F name=John \-F shoesize=11 https://example.com/ |
| 1359 | .fi |
| 1360 | |
| 1361 | Example: send your essay in a text field to the server. Send it as a plain |
| 1362 | text field, but get the contents for it from a local file: |
| 1363 | |
| 1364 | .nf |
| 1365 | curl \-F "story=<hugefile.txt" https://example.com/ |
| 1366 | .fi |
| 1367 | |
| 1368 | You can also tell curl what Content-Type to use by using 'type=', in a manner |
| 1369 | similar to: |
| 1370 | |
| 1371 | .nf |
| 1372 | curl \-F "web=@index.html;type=text/html" example.com |
| 1373 | .fi |
| 1374 | |
| 1375 | or |
| 1376 | |
| 1377 | .nf |
| 1378 | curl \-F "name=daniel;type=text/foo" example.com |
| 1379 | .fi |
| 1380 | |
| 1381 | You can also explicitly change the name field of a file upload part by setting |
| 1382 | filename=, like this: |
| 1383 | |
| 1384 | .nf |
| 1385 | curl \-F "file=@localfile;filename=nameinpost" example.com |
| 1386 | .fi |
| 1387 | |
| 1388 | If filename/path contains ',' or ';', it must be quoted by double-quotes like: |
| 1389 | |
| 1390 | .nf |
| 1391 | curl \-F "file=@\\"local,file\\";filename=\\"name;in;post\\"" example.com |
| 1392 | .fi |
| 1393 | |
| 1394 | or |
| 1395 | |
| 1396 | .nf |
| 1397 | curl \-F 'file=@"local,file";filename="name;in;post"' example.com |
| 1398 | .fi |
| 1399 | |
| 1400 | Note that if a filename/path is quoted by double-quotes, any double-quote |
| 1401 | or backslash within the filename must be escaped by backslash. |
| 1402 | |
| 1403 | Quoting must also be applied to non-file data if it contains semicolons, |
| 1404 | leading/trailing spaces or leading double quotes: |
| 1405 | |
| 1406 | .nf |
| 1407 | curl \-F 'colors="red; green; blue";type=text/x-myapp' example.com |
| 1408 | .fi |
| 1409 | |
| 1410 | You can add custom headers to the field by setting headers=, like |
| 1411 | |
| 1412 | .nf |
| 1413 | curl \-F "submit=OK;headers=\\"X-submit-type: OK\\"" example.com |
| 1414 | .fi |
| 1415 | |
| 1416 | or |
| 1417 | |
| 1418 | .nf |
| 1419 | curl \-F "submit=OK;headers=@headerfile" example.com |
| 1420 | .fi |
| 1421 | |
| 1422 | The headers= keyword may appear more that once and above notes about quoting |
| 1423 | apply. When headers are read from a file, Empty lines and lines starting |
| 1424 | with '#' are comments and ignored; each header can be folded by splitting |
| 1425 | between two words and starting the continuation line with a space; embedded |
| 1426 | carriage-returns and trailing spaces are stripped. |
| 1427 | Here is an example of a header file contents: |
| 1428 | |
| 1429 | .nf |
| 1430 | # This file contain two headers. |
| 1431 | X-header-1: this is a header |
| 1432 | .fi |
| 1433 | |
| 1434 | .nf |
| 1435 | # The following header is folded. |
| 1436 | X-header-2: this is |
| 1437 | another header |
| 1438 | .fi |
| 1439 | |
| 1440 | To support sending multipart mail messages, the syntax is extended as follows: |
| 1441 | .br |
| 1442 | \- name can be omitted: the equal sign is the first character of the argument, |
| 1443 | .br |
| 1444 | \- if data starts with '(', this signals to start a new multipart: it can be |
| 1445 | followed by a content type specification. |
| 1446 | .br |
| 1447 | \- a multipart can be terminated with a '=)' argument. |
| 1448 | |
| 1449 | Example: the following command sends an SMTP mime email consisting in an |
| 1450 | inline part in two alternative formats: plain text and HTML. It attaches a |
| 1451 | text file: |
| 1452 | |
| 1453 | .nf |
| 1454 | curl \-F '=(;type=multipart/alternative' \\ |
| 1455 | \-F '=plain text message' \\ |
| 1456 | \-F '= <body>HTML message</body>;type=text/html' \\ |
| 1457 | \-F '=)' \-F '=@textfile.txt' ... smtp://example.com |
| 1458 | .fi |
| 1459 | |
| 1460 | Data can be encoded for transfer using encoder=. Available encodings are |
| 1461 | \fIbinary\fP and \fI8bit\fP that do nothing else than adding the corresponding |
| 1462 | Content-Transfer-Encoding header, \fI7bit\fP that only rejects 8-bit characters |
| 1463 | with a transfer error, \fIquoted-printable\fP and \fIbase64\fP that encodes data |
| 1464 | according to the corresponding schemes, limiting lines length to 76 |
| 1465 | characters. |
| 1466 | |
| 1467 | Example: send multipart mail with a quoted-printable text message and a |
| 1468 | base64 attached file: |
| 1469 | |
| 1470 | .nf |
| 1471 | curl \-F '=text message;encoder=quoted-printable' \\ |
| 1472 | \-F '=@localfile;encoder=base64' ... smtp://example.com |
| 1473 | .fi |
| 1474 | |
| 1475 | See further examples and details in the MANUAL. |
| 1476 | |
| 1477 | --form can be used several times in a command line |
| 1478 | |
| 1479 | Example: |
| 1480 | .nf |
| 1481 | curl --form "name=curl" --form "file=@loadthis" https://example.com |
| 1482 | .fi |
| 1483 | |
| 1484 | See also \fI-d, --data\fP, \fI--form-string\fP and \fI--form-escape\fP. This option is mutually exclusive to \fI-d, --data\fP and \fI-I, --head\fP and \fI-T, --upload-file\fP. |
| 1485 | .IP "\-\-ftp-account <data>" |
| 1486 | (FTP) When an FTP server asks for "account data" after user name and password has |
| 1487 | been provided, this data is sent off using the ACCT command. |
| 1488 | |
| 1489 | If --ftp-account is provided several times, the last set value will be used. |
| 1490 | |
| 1491 | Example: |
| 1492 | .nf |
| 1493 | curl --ftp-account "mr.robot" ftp://example.com/ |
| 1494 | .fi |
| 1495 | |
| 1496 | See also \fI-u, --user\fP. |
| 1497 | .IP "\-\-ftp-alternative-to-user <command>" |
| 1498 | (FTP) If authenticating with the USER and PASS commands fails, send this command. |
| 1499 | When connecting to Tumbleweed's Secure Transport server over FTPS using a |
| 1500 | client certificate, using "SITE AUTH" will tell the server to retrieve the |
| 1501 | username from the certificate. |
| 1502 | |
| 1503 | If --ftp-alternative-to-user is provided several times, the last set value will be used. |
| 1504 | |
| 1505 | Example: |
| 1506 | .nf |
| 1507 | curl --ftp-alternative-to-user "U53r" ftp://example.com |
| 1508 | .fi |
| 1509 | |
| 1510 | See also \fI--ftp-account\fP and \fI-u, --user\fP. |
| 1511 | .IP "\-\-ftp-create-dirs" |
| 1512 | (FTP SFTP) When an FTP or SFTP URL/operation uses a path that does not currently exist on |
| 1513 | the server, the standard behavior of curl is to fail. Using this option, curl |
| 1514 | will instead attempt to create missing directories. |
| 1515 | |
| 1516 | Providing --ftp-create-dirs multiple times has no extra effect. |
| 1517 | Disable it again with --no-ftp-create-dirs. |
| 1518 | |
| 1519 | Example: |
| 1520 | .nf |
| 1521 | curl --ftp-create-dirs -T file ftp://example.com/remote/path/file |
| 1522 | .fi |
| 1523 | |
| 1524 | See also \fI--create-dirs\fP. |
| 1525 | .IP "\-\-ftp-method <method>" |
| 1526 | (FTP) Control what method curl should use to reach a file on an FTP(S) |
| 1527 | server. The method argument should be one of the following alternatives: |
| 1528 | .RS |
| 1529 | .IP multicwd |
| 1530 | curl does a single CWD operation for each path part in the given URL. For deep |
| 1531 | hierarchies this means many commands. This is how RFC 1738 says it should |
| 1532 | be done. This is the default but the slowest behavior. |
| 1533 | .IP nocwd |
| 1534 | curl does no CWD at all. curl will do SIZE, RETR, STOR etc and give a full |
| 1535 | path to the server for all these commands. This is the fastest behavior. |
| 1536 | .IP singlecwd |
| 1537 | curl does one CWD with the full target directory and then operates on the file |
| 1538 | \(dqnormally" (like in the multicwd case). This is somewhat more standards |
| 1539 | compliant than 'nocwd' but without the full penalty of 'multicwd'. |
| 1540 | .RE |
| 1541 | |
| 1542 | If --ftp-method is provided several times, the last set value will be used. |
| 1543 | |
| 1544 | Examples: |
| 1545 | .nf |
| 1546 | curl --ftp-method multicwd ftp://example.com/dir1/dir2/file |
| 1547 | curl --ftp-method nocwd ftp://example.com/dir1/dir2/file |
| 1548 | curl --ftp-method singlecwd ftp://example.com/dir1/dir2/file |
| 1549 | .fi |
| 1550 | |
| 1551 | See also \fI-l, --list-only\fP. |
| 1552 | .IP "\-\-ftp-pasv" |
| 1553 | (FTP) Use passive mode for the data connection. Passive is the internal default |
| 1554 | behavior, but using this option can be used to override a previous \-\-ftp-port |
| 1555 | option. |
| 1556 | |
| 1557 | Reversing an enforced passive really is not doable but you must then instead |
| 1558 | enforce the correct \-\-ftp-port again. |
| 1559 | |
| 1560 | Passive mode means that curl will try the EPSV command first and then PASV, |
| 1561 | unless \-\-disable-epsv is used. |
| 1562 | |
| 1563 | Providing --ftp-pasv multiple times has no extra effect. |
| 1564 | Disable it again with --no-ftp-pasv. |
| 1565 | |
| 1566 | Example: |
| 1567 | .nf |
| 1568 | curl --ftp-pasv ftp://example.com/ |
| 1569 | .fi |
| 1570 | |
| 1571 | See also \fI--disable-epsv\fP. |
| 1572 | .IP "\-P, \-\-ftp-port <address>" |
| 1573 | (FTP) Reverses the default initiator/listener roles when connecting with FTP. This |
| 1574 | option makes curl use active mode. curl then tells the server to connect back |
| 1575 | to the client's specified address and port, while passive mode asks the server |
| 1576 | to setup an IP address and port for it to connect to. <address> should be one |
| 1577 | of: |
| 1578 | .RS |
| 1579 | .IP interface |
| 1580 | e.g. "eth0" to specify which interface's IP address you want to use (Unix only) |
| 1581 | .IP "IP address" |
| 1582 | e.g. "192.168.10.1" to specify the exact IP address |
| 1583 | .IP "host name" |
| 1584 | e.g. "my.host.domain" to specify the machine |
| 1585 | .IP "-" |
| 1586 | make curl pick the same IP address that is already used for the control |
| 1587 | connection |
| 1588 | .RE |
| 1589 | |
| 1590 | Disable the use of PORT with \fI\-\-ftp-pasv\fP. Disable the attempt to use the EPRT |
| 1591 | command instead of PORT by using \fI\-\-disable-eprt\fP. EPRT is really PORT++. |
| 1592 | |
| 1593 | You can also append ":[start]-[end]\&" to the right of the address, to tell |
| 1594 | curl what TCP port range to use. That means you specify a port range, from a |
| 1595 | lower to a higher number. A single number works as well, but do note that it |
| 1596 | increases the risk of failure since the port may not be available. |
| 1597 | |
| 1598 | |
| 1599 | If --ftp-port is provided several times, the last set value will be used. |
| 1600 | |
| 1601 | Examples: |
| 1602 | .nf |
| 1603 | curl -P - ftp:/example.com |
| 1604 | curl -P eth0 ftp:/example.com |
| 1605 | curl -P 192.168.0.2 ftp:/example.com |
| 1606 | .fi |
| 1607 | |
| 1608 | See also \fI--ftp-pasv\fP and \fI--disable-eprt\fP. |
| 1609 | .IP "\-\-ftp-pret" |
| 1610 | (FTP) Tell curl to send a PRET command before PASV (and EPSV). Certain FTP servers, |
| 1611 | mainly drftpd, require this non-standard command for directory listings as |
| 1612 | well as up and downloads in PASV mode. |
| 1613 | |
| 1614 | Providing --ftp-pret multiple times has no extra effect. |
| 1615 | Disable it again with --no-ftp-pret. |
| 1616 | |
| 1617 | Example: |
| 1618 | .nf |
| 1619 | curl --ftp-pret ftp://example.com/ |
| 1620 | .fi |
| 1621 | |
| 1622 | See also \fI-P, --ftp-port\fP and \fI--ftp-pasv\fP. |
| 1623 | .IP "\-\-ftp-skip-pasv-ip" |
| 1624 | (FTP) Tell curl to not use the IP address the server suggests in its response |
| 1625 | to curl's PASV command when curl connects the data connection. Instead curl |
| 1626 | will re-use the same IP address it already uses for the control |
| 1627 | connection. |
| 1628 | |
| 1629 | Since curl 7.74.0 this option is enabled by default. |
| 1630 | |
| 1631 | This option has no effect if PORT, EPRT or EPSV is used instead of PASV. |
| 1632 | |
| 1633 | Providing --ftp-skip-pasv-ip multiple times has no extra effect. |
| 1634 | Disable it again with --no-ftp-skip-pasv-ip. |
| 1635 | |
| 1636 | Example: |
| 1637 | .nf |
| 1638 | curl --ftp-skip-pasv-ip ftp://example.com/ |
| 1639 | .fi |
| 1640 | |
| 1641 | See also \fI--ftp-pasv\fP. |
| 1642 | .IP "\-\-ftp-ssl-ccc-mode <active/passive>" |
| 1643 | (FTP) Sets the CCC mode. The passive mode will not initiate the shutdown, but |
| 1644 | instead wait for the server to do it, and will not reply to the shutdown from |
| 1645 | the server. The active mode initiates the shutdown and waits for a reply from |
| 1646 | the server. |
| 1647 | |
| 1648 | Providing --ftp-ssl-ccc-mode multiple times has no extra effect. |
| 1649 | Disable it again with --no-ftp-ssl-ccc-mode. |
| 1650 | |
| 1651 | Example: |
| 1652 | .nf |
| 1653 | curl --ftp-ssl-ccc-mode active --ftp-ssl-ccc ftps://example.com/ |
| 1654 | .fi |
| 1655 | |
| 1656 | See also \fI--ftp-ssl-ccc\fP. |
| 1657 | .IP "\-\-ftp-ssl-ccc" |
| 1658 | (FTP) Use CCC (Clear Command Channel) Shuts down the SSL/TLS layer after |
| 1659 | authenticating. The rest of the control channel communication will be |
| 1660 | unencrypted. This allows NAT routers to follow the FTP transaction. The |
| 1661 | default mode is passive. |
| 1662 | |
| 1663 | Providing --ftp-ssl-ccc multiple times has no extra effect. |
| 1664 | Disable it again with --no-ftp-ssl-ccc. |
| 1665 | |
| 1666 | Example: |
| 1667 | .nf |
| 1668 | curl --ftp-ssl-ccc ftps://example.com/ |
| 1669 | .fi |
| 1670 | |
| 1671 | See also \fI--ssl\fP and \fI--ftp-ssl-ccc-mode\fP. |
| 1672 | .IP "\-\-ftp-ssl-control" |
| 1673 | (FTP) Require SSL/TLS for the FTP login, clear for transfer. Allows secure |
| 1674 | authentication, but non-encrypted data transfers for efficiency. Fails the |
| 1675 | transfer if the server does not support SSL/TLS. |
| 1676 | |
| 1677 | Providing --ftp-ssl-control multiple times has no extra effect. |
| 1678 | Disable it again with --no-ftp-ssl-control. |
| 1679 | |
| 1680 | Example: |
| 1681 | .nf |
| 1682 | curl --ftp-ssl-control ftp://example.com |
| 1683 | .fi |
| 1684 | |
| 1685 | See also \fI--ssl\fP. |
| 1686 | .IP "\-G, \-\-get" |
| 1687 | When used, this option will make all data specified with \fI\-d, \-\-data\fP, \-\-data-binary |
| 1688 | or \-\-data-urlencode to be used in an HTTP GET request instead of the POST |
| 1689 | request that otherwise would be used. The data will be appended to the URL |
| 1690 | with a '?' separator. |
| 1691 | |
| 1692 | If used in combination with \fI\-I, \-\-head\fP, the POST data will instead be appended to |
| 1693 | the URL with a HEAD request. |
| 1694 | |
| 1695 | Providing --get multiple times has no extra effect. |
| 1696 | Disable it again with --no-get. |
| 1697 | |
| 1698 | Examples: |
| 1699 | .nf |
| 1700 | curl --get https://example.com |
| 1701 | curl --get -d "tool=curl" -d "age=old" https://example.com |
| 1702 | curl --get -I -d "tool=curl" https://example.com |
| 1703 | .fi |
| 1704 | |
| 1705 | See also \fI-d, --data\fP and \fI-X, --request\fP. |
| 1706 | .IP "\-g, \-\-globoff" |
| 1707 | This option switches off the "URL globbing parser". When you set this option, |
| 1708 | you can specify URLs that contain the letters {}[] without having curl itself |
| 1709 | interpret them. Note that these letters are not normal legal URL contents but |
| 1710 | they should be encoded according to the URI standard. |
| 1711 | |
| 1712 | Providing --globoff multiple times has no extra effect. |
| 1713 | Disable it again with --no-globoff. |
| 1714 | |
| 1715 | Example: |
| 1716 | .nf |
| 1717 | curl -g "https://example.com/{[]}}}}" |
| 1718 | .fi |
| 1719 | |
| 1720 | See also \fI-K, --config\fP and \fI-q, --disable\fP. |
| 1721 | .IP "\-\-happy-eyeballs-timeout-ms <milliseconds>" |
| 1722 | Happy Eyeballs is an algorithm that attempts to connect to both IPv4 and IPv6 |
| 1723 | addresses for dual-stack hosts, giving IPv6 a head-start of the specified |
| 1724 | number of milliseconds. If the IPv6 address cannot be connected to within that |
| 1725 | time, then a connection attempt is made to the IPv4 address in parallel. The |
| 1726 | first connection to be established is the one that is used. |
| 1727 | |
| 1728 | The range of suggested useful values is limited. Happy Eyeballs RFC 6555 says |
| 1729 | \(dqIt is RECOMMENDED that connection attempts be paced 150-250 ms apart to |
| 1730 | balance human factors against network load." libcurl currently defaults to |
| 1731 | 200 ms. Firefox and Chrome currently default to 300 ms. |
| 1732 | |
| 1733 | If --happy-eyeballs-timeout-ms is provided several times, the last set value will be used. |
| 1734 | |
| 1735 | Example: |
| 1736 | .nf |
| 1737 | curl --happy-eyeballs-timeout-ms 500 https://example.com |
| 1738 | .fi |
| 1739 | |
| 1740 | See also \fI-m, --max-time\fP and \fI--connect-timeout\fP. Added in 7.59.0. |
| 1741 | .IP "\-\-haproxy-protocol" |
| 1742 | (HTTP) Send a HAProxy PROXY protocol v1 header at the beginning of the |
| 1743 | connection. This is used by some load balancers and reverse proxies to |
| 1744 | indicate the client's true IP address and port. |
| 1745 | |
| 1746 | This option is primarily useful when sending test requests to a service that |
| 1747 | expects this header. |
| 1748 | |
| 1749 | Providing --haproxy-protocol multiple times has no extra effect. |
| 1750 | Disable it again with --no-haproxy-protocol. |
| 1751 | |
| 1752 | Example: |
| 1753 | .nf |
| 1754 | curl --haproxy-protocol https://example.com |
| 1755 | .fi |
| 1756 | |
| 1757 | See also \fI-x, --proxy\fP. Added in 7.60.0. |
| 1758 | .IP "\-I, \-\-head" |
| 1759 | (HTTP FTP FILE) Fetch the headers only! HTTP-servers feature the command HEAD which this uses |
| 1760 | to get nothing but the header of a document. When used on an FTP or FILE file, |
| 1761 | curl displays the file size and last modification time only. |
| 1762 | |
| 1763 | Providing --head multiple times has no extra effect. |
| 1764 | Disable it again with --no-head. |
| 1765 | |
| 1766 | Example: |
| 1767 | .nf |
| 1768 | curl -I https://example.com |
| 1769 | .fi |
| 1770 | |
| 1771 | See also \fI-G, --get\fP, \fI-v, --verbose\fP and \fI--trace-ascii\fP. |
| 1772 | .IP "\-H, \-\-header <header/@file>" |
| 1773 | (HTTP IMAP SMTP) Extra header to include in information sent. When used within an HTTP request, |
| 1774 | it is added to the regular request headers. |
| 1775 | |
| 1776 | For an IMAP or SMTP MIME uploaded mail built with \-\-form options, it is |
| 1777 | prepended to the resulting MIME document, effectively including it at the mail |
| 1778 | global level. It does not affect raw uploaded mails (Added in 7.56.0). |
| 1779 | |
| 1780 | You may specify any number of extra headers. Note that if you should add a |
| 1781 | custom header that has the same name as one of the internal ones curl would |
| 1782 | use, your externally set header will be used instead of the internal one. |
| 1783 | This allows you to make even trickier stuff than curl would normally do. You |
| 1784 | should not replace internally set headers without knowing perfectly well what |
| 1785 | you are doing. Remove an internal header by giving a replacement without |
| 1786 | content on the right side of the colon, as in: \-H "Host:". If you send the |
| 1787 | custom header with no-value then its header must be terminated with a |
| 1788 | semicolon, such as \-H "X-Custom-Header;" to send "X-Custom-Header:". |
| 1789 | |
| 1790 | curl will make sure that each header you add/replace is sent with the proper |
| 1791 | end-of-line marker, you should thus \fBnot\fP add that as a part of the header |
| 1792 | content: do not add newlines or carriage returns, they will only mess things |
| 1793 | up for you. |
| 1794 | |
| 1795 | This option can take an argument in @filename style, which then adds a header |
| 1796 | for each line in the input file. Using @- will make curl read the header file |
| 1797 | from stdin. Added in 7.55.0. |
| 1798 | |
| 1799 | Please note that most anti-spam utilities check the presence and value of |
| 1800 | several MIME mail headers: these are "From:", "To:", "Date:" and "Subject:" |
| 1801 | among others and should be added with this option. |
| 1802 | |
| 1803 | You need \-\-proxy-header to send custom headers intended for an HTTP |
| 1804 | proxy. Added in 7.37.0. |
| 1805 | |
| 1806 | Passing on a "Transfer-Encoding: chunked" header when doing an HTTP request |
| 1807 | with a request body, will make curl send the data using chunked encoding. |
| 1808 | |
| 1809 | \fBWARNING\fP: headers set with this option will be set in all HTTP requests |
| 1810 | \- even after redirects are followed, like when told with \fI\-L, \-\-location\fP. This can |
| 1811 | lead to the header being sent to other hosts than the original host, so |
| 1812 | sensitive headers should be used with caution combined with following |
| 1813 | redirects. |
| 1814 | |
| 1815 | --header can be used several times in a command line |
| 1816 | |
| 1817 | Examples: |
| 1818 | .nf |
| 1819 | curl -H "X-First-Name: Joe" https://example.com |
| 1820 | curl -H "User-Agent: yes-please/2000" https://example.com |
| 1821 | curl -H "Host:" https://example.com |
| 1822 | .fi |
| 1823 | |
| 1824 | See also \fI-A, --user-agent\fP and \fI-e, --referer\fP. |
| 1825 | .IP "\-h, \-\-help <category>" |
| 1826 | Usage help. This lists all commands of the <category>. |
| 1827 | If no arg was provided, curl will display the most important |
| 1828 | command line arguments. |
| 1829 | If the argument "all" was provided, curl will display all options available. |
| 1830 | If the argument "category" was provided, curl will display all categories and |
| 1831 | their meanings. |
| 1832 | |
| 1833 | Providing --help multiple times has no extra effect. |
| 1834 | Disable it again with --no-help. |
| 1835 | |
| 1836 | Example: |
| 1837 | .nf |
| 1838 | curl --help all |
| 1839 | .fi |
| 1840 | |
| 1841 | See also \fI-v, --verbose\fP. |
| 1842 | .IP "\-\-hostpubmd5 <md5>" |
| 1843 | (SFTP SCP) Pass a string containing 32 hexadecimal digits. The string should |
| 1844 | be the 128 bit MD5 checksum of the remote host's public key, curl will refuse |
| 1845 | the connection with the host unless the md5sums match. |
| 1846 | |
| 1847 | If --hostpubmd5 is provided several times, the last set value will be used. |
| 1848 | |
| 1849 | Example: |
| 1850 | .nf |
| 1851 | curl --hostpubmd5 e5c1c49020640a5ab0f2034854c321a8 sftp://example.com/ |
| 1852 | .fi |
| 1853 | |
| 1854 | See also \fI--hostpubsha256\fP. |
| 1855 | .IP "\-\-hostpubsha256 <sha256>" |
| 1856 | (SFTP SCP) Pass a string containing a Base64-encoded SHA256 hash of the remote |
| 1857 | host's public key. Curl will refuse the connection with the host |
| 1858 | unless the hashes match. |
| 1859 | |
| 1860 | If --hostpubsha256 is provided several times, the last set value will be used. |
| 1861 | |
| 1862 | Example: |
| 1863 | .nf |
| 1864 | curl --hostpubsha256 NDVkMTQxMGQ1ODdmMjQ3MjczYjAyOTY5MmRkMjVmNDQ= sftp://example.com/ |
| 1865 | .fi |
| 1866 | |
| 1867 | See also \fI--hostpubmd5\fP. Added in 7.80.0. |
| 1868 | .IP "\-\-hsts <file name>" |
| 1869 | (HTTPS) This option enables HSTS for the transfer. If the file name points to an |
| 1870 | existing HSTS cache file, that will be used. After a completed transfer, the |
| 1871 | cache will be saved to the file name again if it has been modified. |
| 1872 | |
| 1873 | Specify a "" file name (zero length) to avoid loading/saving and make curl |
| 1874 | just handle HSTS in memory. |
| 1875 | |
| 1876 | If this option is used several times, curl will load contents from all the |
| 1877 | files but the last one will be used for saving. |
| 1878 | |
| 1879 | --hsts can be used several times in a command line |
| 1880 | |
| 1881 | Example: |
| 1882 | .nf |
| 1883 | curl --hsts cache.txt https://example.com |
| 1884 | .fi |
| 1885 | |
| 1886 | See also \fI--proto\fP. Added in 7.74.0. |
| 1887 | .IP "\-\-http0.9" |
| 1888 | (HTTP) Tells curl to be fine with HTTP version 0.9 response. |
| 1889 | |
| 1890 | HTTP/0.9 is a completely headerless response and therefore you can also |
| 1891 | connect with this to non-HTTP servers and still get a response since curl will |
| 1892 | simply transparently downgrade \- if allowed. |
| 1893 | |
| 1894 | Since curl 7.66.0, HTTP/0.9 is disabled by default. |
| 1895 | |
| 1896 | Providing --http0.9 multiple times has no extra effect. |
| 1897 | Disable it again with --no-http0.9. |
| 1898 | |
| 1899 | Example: |
| 1900 | .nf |
| 1901 | curl --http0.9 https://example.com |
| 1902 | .fi |
| 1903 | |
| 1904 | See also \fI--http1.1\fP, \fI--http2\fP and \fI--http3\fP. Added in 7.64.0. |
| 1905 | .IP "\-0, \-\-http1.0" |
| 1906 | (HTTP) Tells curl to use HTTP version 1.0 instead of using its internally preferred |
| 1907 | HTTP version. |
| 1908 | |
| 1909 | Providing --http1.0 multiple times has no extra effect. |
| 1910 | |
| 1911 | Example: |
| 1912 | .nf |
| 1913 | curl --http1.0 https://example.com |
| 1914 | .fi |
| 1915 | |
| 1916 | See also \fI--http0.9\fP and \fI--http1.1\fP. This option is mutually exclusive to \fI--http1.1\fP and \fI--http2\fP and \fI--http2-prior-knowledge\fP and \fI--http3\fP. |
| 1917 | .IP "\-\-http1.1" |
| 1918 | (HTTP) Tells curl to use HTTP version 1.1. |
| 1919 | |
| 1920 | Providing --http1.1 multiple times has no extra effect. |
| 1921 | |
| 1922 | Example: |
| 1923 | .nf |
| 1924 | curl --http1.1 https://example.com |
| 1925 | .fi |
| 1926 | |
| 1927 | See also \fI-0, --http1.0\fP and \fI--http0.9\fP. This option is mutually exclusive to \fI-0, --http1.0\fP and \fI--http2\fP and \fI--http2-prior-knowledge\fP and \fI--http3\fP. Added in 7.33.0. |
| 1928 | .IP "\-\-http2-prior-knowledge" |
| 1929 | (HTTP) Tells curl to issue its non-TLS HTTP requests using HTTP/2 without HTTP/1.1 |
| 1930 | Upgrade. It requires prior knowledge that the server supports HTTP/2 straight |
| 1931 | away. HTTPS requests will still do HTTP/2 the standard way with negotiated |
| 1932 | protocol version in the TLS handshake. |
| 1933 | |
| 1934 | Providing --http2-prior-knowledge multiple times has no extra effect. |
| 1935 | Disable it again with --no-http2-prior-knowledge. |
| 1936 | |
| 1937 | Example: |
| 1938 | .nf |
| 1939 | curl --http2-prior-knowledge https://example.com |
| 1940 | .fi |
| 1941 | |
| 1942 | See also \fI--http2\fP and \fI--http3\fP. \fI--http2-prior-knowledge\fP requires that the underlying libcurl was built to support HTTP/2. This option is mutually exclusive to \fI--http1.1\fP and \fI-0, --http1.0\fP and \fI--http2\fP and \fI--http3\fP. Added in 7.49.0. |
| 1943 | .IP "\-\-http2" |
| 1944 | (HTTP) Tells curl to use HTTP version 2. |
| 1945 | |
| 1946 | For HTTPS, this means curl will attempt to negotiate HTTP/2 in the TLS |
| 1947 | handshake. curl does this by default. |
| 1948 | |
| 1949 | For HTTP, this means curl will attempt to upgrade the request to HTTP/2 using |
| 1950 | the Upgrade: request header. |
| 1951 | |
| 1952 | When curl uses HTTP/2 over HTTPS, it does not itself insist on TLS 1.2 or |
| 1953 | higher even though that is required by the specification. A user can add this |
| 1954 | version requirement with \fI\-\-tlsv1.2\fP. |
| 1955 | |
| 1956 | Providing --http2 multiple times has no extra effect. |
| 1957 | |
| 1958 | Example: |
| 1959 | .nf |
| 1960 | curl --http2 https://example.com |
| 1961 | .fi |
| 1962 | |
| 1963 | See also \fI--http1.1\fP and \fI--http3\fP. \fI--http2\fP requires that the underlying libcurl was built to support HTTP/2. This option is mutually exclusive to \fI--http1.1\fP and \fI-0, --http1.0\fP and \fI--http2-prior-knowledge\fP and \fI--http3\fP. Added in 7.33.0. |
| 1964 | .IP "\-\-http3" |
| 1965 | (HTTP) **WARNING**: this option is experimental. Do not use in production. |
| 1966 | |
| 1967 | Tells curl to use HTTP version 3 directly to the host and port number used in |
| 1968 | the URL. A normal HTTP/3 transaction will be done to a host and then get |
| 1969 | redirected via Alt-Svc, but this option allows a user to circumvent that when |
| 1970 | you know that the target speaks HTTP/3 on the given host and port. |
| 1971 | |
| 1972 | This option will make curl fail if a QUIC connection cannot be established, it |
| 1973 | cannot fall back to a lower HTTP version on its own. |
| 1974 | |
| 1975 | Providing --http3 multiple times has no extra effect. |
| 1976 | |
| 1977 | Example: |
| 1978 | .nf |
| 1979 | curl --http3 https://example.com |
| 1980 | .fi |
| 1981 | |
| 1982 | See also \fI--http1.1\fP and \fI--http2\fP. \fI--http3\fP requires that the underlying libcurl was built to support HTTP/3. This option is mutually exclusive to \fI--http1.1\fP and \fI-0, --http1.0\fP and \fI--http2\fP and \fI--http2-prior-knowledge\fP. Added in 7.66.0. |
| 1983 | .IP "\-\-ignore-content-length" |
| 1984 | (FTP HTTP) For HTTP, Ignore the Content-Length header. This is particularly useful for |
| 1985 | servers running Apache 1.x, which will report incorrect Content-Length for |
| 1986 | files larger than 2 gigabytes. |
| 1987 | |
| 1988 | For FTP (since 7.46.0), skip the RETR command to figure out the size before |
| 1989 | downloading a file. |
| 1990 | |
| 1991 | This option does not work for HTTP if libcurl was built to use hyper. |
| 1992 | |
| 1993 | Providing --ignore-content-length multiple times has no extra effect. |
| 1994 | Disable it again with --no-ignore-content-length. |
| 1995 | |
| 1996 | Example: |
| 1997 | .nf |
| 1998 | curl --ignore-content-length https://example.com |
| 1999 | .fi |
| 2000 | |
| 2001 | See also \fI--ftp-skip-pasv-ip\fP. |
| 2002 | .IP "\-i, \-\-include" |
| 2003 | Include the HTTP response headers in the output. The HTTP response headers can |
| 2004 | include things like server name, cookies, date of the document, HTTP version |
| 2005 | and more... |
| 2006 | |
| 2007 | To view the request headers, consider the \-\-verbose option. |
| 2008 | |
| 2009 | Providing --include multiple times has no extra effect. |
| 2010 | Disable it again with --no-include. |
| 2011 | |
| 2012 | Example: |
| 2013 | .nf |
| 2014 | curl -i https://example.com |
| 2015 | .fi |
| 2016 | |
| 2017 | See also \fI-v, --verbose\fP. |
| 2018 | .IP "\-k, \-\-insecure" |
| 2019 | (TLS SFTP SCP) By default, every secure connection curl makes is verified to be secure before |
| 2020 | the transfer takes place. This option makes curl skip the verification step |
| 2021 | and proceed without checking. |
| 2022 | |
| 2023 | When this option is not used for protocols using TLS, curl verifies the |
| 2024 | server's TLS certificate before it continues: that the certificate contains |
| 2025 | the right name which matches the host name used in the URL and that the |
| 2026 | certificate has been signed by a CA certificate present in the cert store. |
| 2027 | See this online resource for further details: |
| 2028 | .nf |
| 2029 | https://curl.se/docs/sslcerts.html |
| 2030 | .fi |
| 2031 | |
| 2032 | For SFTP and SCP, this option makes curl skip the \fIknown_hosts\fP verification. |
| 2033 | \fIknown_hosts\fP is a file normally stored in the user's home directory in the |
| 2034 | \(dq.ssh" subdirectory, which contains host names and their public keys. |
| 2035 | |
| 2036 | \fBWARNING\fP: using this option makes the transfer insecure. |
| 2037 | |
| 2038 | Providing --insecure multiple times has no extra effect. |
| 2039 | Disable it again with --no-insecure. |
| 2040 | |
| 2041 | Example: |
| 2042 | .nf |
| 2043 | curl --insecure https://example.com |
| 2044 | .fi |
| 2045 | |
| 2046 | See also \fI--proxy-insecure\fP, \fI--cacert\fP and \fI--capath\fP. |
| 2047 | .IP "\-\-interface <name>" |
| 2048 | Perform an operation using a specified interface. You can enter interface |
| 2049 | name, IP address or host name. An example could look like: |
| 2050 | |
| 2051 | .nf |
| 2052 | curl \-\-interface eth0:1 https://www.example.com/ |
| 2053 | .fi |
| 2054 | |
| 2055 | On Linux it can be used to specify a VRF, but the binary needs to either |
| 2056 | have CAP_NET_RAW or to be run as root. More information about Linux VRF: |
| 2057 | https://www.kernel.org/doc/Documentation/networking/vrf.txt |
| 2058 | |
| 2059 | If --interface is provided several times, the last set value will be used. |
| 2060 | |
| 2061 | Example: |
| 2062 | .nf |
| 2063 | curl --interface eth0 https://example.com |
| 2064 | .fi |
| 2065 | |
| 2066 | See also \fI--dns-interface\fP. |
| 2067 | .IP "\-4, \-\-ipv4" |
| 2068 | This option tells curl to use IPv4 addresses only, and not for example try |
| 2069 | IPv6. |
| 2070 | |
| 2071 | Providing --ipv4 multiple times has no extra effect. |
| 2072 | Disable it again with --no-ipv4. |
| 2073 | |
| 2074 | Example: |
| 2075 | .nf |
| 2076 | curl --ipv4 https://example.com |
| 2077 | .fi |
| 2078 | |
| 2079 | See also \fI--http1.1\fP and \fI--http2\fP. This option is mutually exclusive to \fI-6, --ipv6\fP. |
| 2080 | .IP "\-6, \-\-ipv6" |
| 2081 | This option tells curl to use IPv6 addresses only, and not for example try |
| 2082 | IPv4. |
| 2083 | |
| 2084 | Providing --ipv6 multiple times has no extra effect. |
| 2085 | Disable it again with --no-ipv6. |
| 2086 | |
| 2087 | Example: |
| 2088 | .nf |
| 2089 | curl --ipv6 https://example.com |
| 2090 | .fi |
| 2091 | |
| 2092 | See also \fI--http1.1\fP and \fI--http2\fP. This option is mutually exclusive to \fI-4, --ipv4\fP. |
| 2093 | .IP "\-\-json <data>" |
| 2094 | (HTTP) Sends the specified JSON data in a POST request to the HTTP server. \-\-json |
| 2095 | works as a shortcut for passing on these three options: |
| 2096 | |
| 2097 | .nf |
| 2098 | \-\-data [arg] |
| 2099 | \-\-header "Content-Type: application/json" |
| 2100 | \-\-header "Accept: application/json" |
| 2101 | .fi |
| 2102 | |
| 2103 | There is \fI\fPno verification\fI\fP that the passed in data is actual JSON or that |
| 2104 | the syntax is correct. |
| 2105 | |
| 2106 | If you start the data with the letter @, the rest should be a file name to |
| 2107 | read the data from, or a single dash (-) if you want curl to read the data |
| 2108 | from stdin. Posting data from a file named 'foobar' would thus be done with |
| 2109 | \fI\-\-json\fP @foobar and to instead read the data from stdin, use \-\-json @-. |
| 2110 | |
| 2111 | If this option is used more than once on the same command line, the additional |
| 2112 | data pieces will be concatenated to the previous before sending. |
| 2113 | |
| 2114 | The headers this option sets can be overridden with \-\-header as usual. |
| 2115 | |
| 2116 | --json can be used several times in a command line |
| 2117 | |
| 2118 | Examples: |
| 2119 | .nf |
| 2120 | curl --json '{ "drink": "coffe" }' https://example.com |
| 2121 | curl --json '{ "drink":' --json ' "coffe" }' https://example.com |
| 2122 | curl --json @prepared https://example.com |
| 2123 | curl --json @- https://example.com < json.txt |
| 2124 | .fi |
| 2125 | |
| 2126 | See also \fI--data-binary\fP and \fI--data-raw\fP. This option is mutually exclusive to \fI-F, --form\fP and \fI-I, --head\fP and \fI-T, --upload-file\fP. Added in 7.82.0. |
| 2127 | .IP "\-j, \-\-junk-session-cookies" |
| 2128 | (HTTP) When curl is told to read cookies from a given file, this option will make it |
| 2129 | discard all "session cookies". This will basically have the same effect as if |
| 2130 | a new session is started. Typical browsers always discard session cookies when |
| 2131 | they are closed down. |
| 2132 | |
| 2133 | Providing --junk-session-cookies multiple times has no extra effect. |
| 2134 | Disable it again with --no-junk-session-cookies. |
| 2135 | |
| 2136 | Example: |
| 2137 | .nf |
| 2138 | curl --junk-session-cookies -b cookies.txt https://example.com |
| 2139 | .fi |
| 2140 | |
| 2141 | See also \fI-b, --cookie\fP and \fI-c, --cookie-jar\fP. |
| 2142 | .IP "\-\-keepalive-time <seconds>" |
| 2143 | This option sets the time a connection needs to remain idle before sending |
| 2144 | keepalive probes and the time between individual keepalive probes. It is |
| 2145 | currently effective on operating systems offering the TCP_KEEPIDLE and |
| 2146 | TCP_KEEPINTVL socket options (meaning Linux, recent AIX, HP-UX and more). |
| 2147 | Keepalives are used by the TCP stack to detect broken networks on idle |
| 2148 | connections. The number of missed keepalive probes before declaring the |
| 2149 | connection down is OS dependent and is commonly 9 or 10. This option has no |
| 2150 | effect if \-\-no-keepalive is used. |
| 2151 | |
| 2152 | If unspecified, the option defaults to 60 seconds. |
| 2153 | |
| 2154 | If --keepalive-time is provided several times, the last set value will be used. |
| 2155 | |
| 2156 | Example: |
| 2157 | .nf |
| 2158 | curl --keepalive-time 20 https://example.com |
| 2159 | .fi |
| 2160 | |
| 2161 | See also \fI--no-keepalive\fP and \fI-m, --max-time\fP. |
| 2162 | .IP "\-\-key-type <type>" |
| 2163 | (TLS) Private key file type. Specify which type your \-\-key provided private key |
| 2164 | is. DER, PEM, and ENG are supported. If not specified, PEM is assumed. |
| 2165 | |
| 2166 | If --key-type is provided several times, the last set value will be used. |
| 2167 | |
| 2168 | Example: |
| 2169 | .nf |
| 2170 | curl --key-type DER --key here https://example.com |
| 2171 | .fi |
| 2172 | |
| 2173 | See also \fI--key\fP. |
| 2174 | .IP "\-\-key <key>" |
| 2175 | (TLS SSH) Private key file name. Allows you to provide your private key in this separate |
| 2176 | file. For SSH, if not specified, curl tries the following candidates in order: |
| 2177 | \(aq~/.ssh/id_rsa', '~/.ssh/id_dsa', './id_rsa', './id_dsa'. |
| 2178 | |
| 2179 | If curl is built against OpenSSL library, and the engine pkcs11 is available, |
| 2180 | then a PKCS#11 URI (RFC 7512) can be used to specify a private key located in a |
| 2181 | PKCS#11 device. A string beginning with "pkcs11:" will be interpreted as a |
| 2182 | PKCS#11 URI. If a PKCS#11 URI is provided, then the \-\-engine option will be set |
| 2183 | as "pkcs11" if none was provided and the \-\-key-type option will be set as |
| 2184 | \(dqENG" if none was provided. |
| 2185 | |
| 2186 | If curl is built against Secure Transport or Schannel then this option is |
| 2187 | ignored for TLS protocols (HTTPS, etc). Those backends expect the private key |
| 2188 | to be already present in the keychain or PKCS#12 file containing the |
| 2189 | certificate. |
| 2190 | |
| 2191 | If --key is provided several times, the last set value will be used. |
| 2192 | |
| 2193 | Example: |
| 2194 | .nf |
| 2195 | curl --cert certificate --key here https://example.com |
| 2196 | .fi |
| 2197 | |
| 2198 | See also \fI--key-type\fP and \fI-E, --cert\fP. |
| 2199 | .IP "\-\-krb <level>" |
| 2200 | (FTP) Enable Kerberos authentication and use. The level must be entered and should |
| 2201 | be one of 'clear', 'safe', 'confidential', or 'private'. Should you use a |
| 2202 | level that is not one of these, 'private' will instead be used. |
| 2203 | |
| 2204 | If --krb is provided several times, the last set value will be used. |
| 2205 | |
| 2206 | Example: |
| 2207 | .nf |
| 2208 | curl --krb clear ftp://example.com/ |
| 2209 | .fi |
| 2210 | |
| 2211 | See also \fI--delegation\fP and \fI--ssl\fP. \fI--krb\fP requires that the underlying libcurl was built to support Kerberos. |
| 2212 | .IP "\-\-libcurl <file>" |
| 2213 | Append this option to any ordinary curl command line, and you will get |
| 2214 | libcurl-using C source code written to the file that does the equivalent |
| 2215 | of what your command-line operation does! |
| 2216 | |
| 2217 | This option is global and does not need to be specified for each use of |
| 2218 | \fI\-:, \-\-next\fP. |
| 2219 | |
| 2220 | If --libcurl is provided several times, the last set value will be used. |
| 2221 | |
| 2222 | Example: |
| 2223 | .nf |
| 2224 | curl --libcurl client.c https://example.com |
| 2225 | .fi |
| 2226 | |
| 2227 | See also \fI-v, --verbose\fP. |
| 2228 | .IP "\-\-limit-rate <speed>" |
| 2229 | Specify the maximum transfer rate you want curl to use \- for both downloads |
| 2230 | and uploads. This feature is useful if you have a limited pipe and you would like |
| 2231 | your transfer not to use your entire bandwidth. To make it slower than it |
| 2232 | otherwise would be. |
| 2233 | |
| 2234 | The given speed is measured in bytes/second, unless a suffix is appended. |
| 2235 | Appending 'k' or 'K' will count the number as kilobytes, 'm' or 'M' makes it |
| 2236 | megabytes, while 'g' or 'G' makes it gigabytes. The suffixes (k, M, G, T, P) |
| 2237 | are 1024 based. For example 1k is 1024. Examples: 200K, 3m and 1G. |
| 2238 | |
| 2239 | The rate limiting logic works on averaging the transfer speed to no more than |
| 2240 | the set threshold over a period of multiple seconds. |
| 2241 | |
| 2242 | If you also use the \-\-speed-limit option, that option will take precedence and |
| 2243 | might cripple the rate-limiting slightly, to help keeping the speed-limit |
| 2244 | logic working. |
| 2245 | |
| 2246 | If --limit-rate is provided several times, the last set value will be used. |
| 2247 | |
| 2248 | Examples: |
| 2249 | .nf |
| 2250 | curl --limit-rate 100K https://example.com |
| 2251 | curl --limit-rate 1000 https://example.com |
| 2252 | curl --limit-rate 10M https://example.com |
| 2253 | .fi |
| 2254 | |
| 2255 | See also \fI-Y, --speed-limit\fP and \fI-y, --speed-time\fP. |
| 2256 | .IP "\-l, \-\-list-only" |
| 2257 | (FTP POP3) (FTP) |
| 2258 | When listing an FTP directory, this switch forces a name-only view. This is |
| 2259 | especially useful if the user wants to machine-parse the contents of an FTP |
| 2260 | directory since the normal directory view does not use a standard look or |
| 2261 | format. When used like this, the option causes an NLST command to be sent to |
| 2262 | the server instead of LIST. |
| 2263 | |
| 2264 | Note: Some FTP servers list only files in their response to NLST; they do not |
| 2265 | include sub-directories and symbolic links. |
| 2266 | |
| 2267 | (POP3) |
| 2268 | When retrieving a specific email from POP3, this switch forces a LIST command |
| 2269 | to be performed instead of RETR. This is particularly useful if the user wants |
| 2270 | to see if a specific message-id exists on the server and what size it is. |
| 2271 | |
| 2272 | Note: When combined with \fI\-X, \-\-request\fP, this option can be used to send a UIDL |
| 2273 | command instead, so the user may use the email's unique identifier rather than |
| 2274 | its message-id to make the request. |
| 2275 | |
| 2276 | Providing --list-only multiple times has no extra effect. |
| 2277 | Disable it again with --no-list-only. |
| 2278 | |
| 2279 | Example: |
| 2280 | .nf |
| 2281 | curl --list-only ftp://example.com/dir/ |
| 2282 | .fi |
| 2283 | |
| 2284 | See also \fI-Q, --quote\fP and \fI-X, --request\fP. |
| 2285 | .IP "\-\-local-port <num/range>" |
| 2286 | Set a preferred single number or range (FROM-TO) of local port numbers to use |
| 2287 | for the connection(s). Note that port numbers by nature are a scarce resource |
| 2288 | that will be busy at times so setting this range to something too narrow might |
| 2289 | cause unnecessary connection setup failures. |
| 2290 | |
| 2291 | If --local-port is provided several times, the last set value will be used. |
| 2292 | |
| 2293 | Example: |
| 2294 | .nf |
| 2295 | curl --local-port 1000-3000 https://example.com |
| 2296 | .fi |
| 2297 | |
| 2298 | See also \fI-g, --globoff\fP. |
| 2299 | .IP "\-\-location-trusted" |
| 2300 | (HTTP) Like \fI\-L, \-\-location\fP, but will allow sending the name + password to all hosts that |
| 2301 | the site may redirect to. This may or may not introduce a security breach if |
| 2302 | the site redirects you to a site to which you will send your authentication |
| 2303 | info (which is plaintext in the case of HTTP Basic authentication). |
| 2304 | |
| 2305 | Providing --location-trusted multiple times has no extra effect. |
| 2306 | Disable it again with --no-location-trusted. |
| 2307 | |
| 2308 | Example: |
| 2309 | .nf |
| 2310 | curl --location-trusted -u user:password https://example.com |
| 2311 | .fi |
| 2312 | |
| 2313 | See also \fI-u, --user\fP. |
| 2314 | .IP "\-L, \-\-location" |
| 2315 | (HTTP) If the server reports that the requested page has moved to a different |
| 2316 | location (indicated with a Location: header and a 3XX response code), this |
| 2317 | option will make curl redo the request on the new place. If used together with |
| 2318 | \-\-include or \fI\-I, \-\-head\fP, headers from all requested pages will be shown. When |
| 2319 | authentication is used, curl only sends its credentials to the initial |
| 2320 | host. If a redirect takes curl to a different host, it will not be able to |
| 2321 | intercept the user+password. See also \-\-location-trusted on how to change |
| 2322 | this. You can limit the amount of redirects to follow by using the |
| 2323 | \-\-max-redirs option. |
| 2324 | |
| 2325 | When curl follows a redirect and if the request is a POST, it will send the |
| 2326 | following request with a GET if the HTTP response was 301, 302, or 303. If the |
| 2327 | response code was any other 3xx code, curl will re-send the following request |
| 2328 | using the same unmodified method. |
| 2329 | |
| 2330 | You can tell curl to not change POST requests to GET after a 30x response by |
| 2331 | using the dedicated options for that: \fI\-\-post301\fP, \-\-post302 and \fI\-\-post303\fP. |
| 2332 | |
| 2333 | The method set with \-\-request overrides the method curl would otherwise select |
| 2334 | to use. |
| 2335 | |
| 2336 | Providing --location multiple times has no extra effect. |
| 2337 | Disable it again with --no-location. |
| 2338 | |
| 2339 | Example: |
| 2340 | .nf |
| 2341 | curl -L https://example.com |
| 2342 | .fi |
| 2343 | |
| 2344 | See also \fI--resolve\fP and \fI--alt-svc\fP. |
| 2345 | .IP "\-\-login-options <options>" |
| 2346 | (IMAP LDAP POP3 SMTP) Specify the login options to use during server authentication. |
| 2347 | |
| 2348 | You can use login options to specify protocol specific options that may be |
| 2349 | used during authentication. At present only IMAP, POP3 and SMTP support |
| 2350 | login options. For more information about login options please see RFC |
| 2351 | 2384, RFC 5092 and IETF draft draft-earhart-url-smtp-00.txt |
| 2352 | |
| 2353 | If --login-options is provided several times, the last set value will be used. |
| 2354 | |
| 2355 | Example: |
| 2356 | .nf |
| 2357 | curl --login-options 'AUTH=*' imap://example.com |
| 2358 | .fi |
| 2359 | |
| 2360 | See also \fI-u, --user\fP. Added in 7.34.0. |
| 2361 | .IP "\-\-mail-auth <address>" |
| 2362 | (SMTP) Specify a single address. This will be used to specify the authentication |
| 2363 | address (identity) of a submitted message that is being relayed to another |
| 2364 | server. |
| 2365 | |
| 2366 | If --mail-auth is provided several times, the last set value will be used. |
| 2367 | |
| 2368 | Example: |
| 2369 | .nf |
| 2370 | curl --mail-auth user@example.come -T mail smtp://example.com/ |
| 2371 | .fi |
| 2372 | |
| 2373 | See also \fI--mail-rcpt\fP and \fI--mail-from\fP. |
| 2374 | .IP "\-\-mail-from <address>" |
| 2375 | (SMTP) Specify a single address that the given mail should get sent from. |
| 2376 | |
| 2377 | If --mail-from is provided several times, the last set value will be used. |
| 2378 | |
| 2379 | Example: |
| 2380 | .nf |
| 2381 | curl --mail-from user@example.com -T mail smtp://example.com/ |
| 2382 | .fi |
| 2383 | |
| 2384 | See also \fI--mail-rcpt\fP and \fI--mail-auth\fP. |
| 2385 | .IP "\-\-mail-rcpt-allowfails" |
| 2386 | (SMTP) When sending data to multiple recipients, by default curl will abort SMTP |
| 2387 | conversation if at least one of the recipients causes RCPT TO command to |
| 2388 | return an error. |
| 2389 | |
| 2390 | The default behavior can be changed by passing \-\-mail-rcpt-allowfails |
| 2391 | command-line option which will make curl ignore errors and proceed with the |
| 2392 | remaining valid recipients. |
| 2393 | |
| 2394 | If all recipients trigger RCPT TO failures and this flag is specified, curl |
| 2395 | will still abort the SMTP conversation and return the error received from to |
| 2396 | the last RCPT TO command. |
| 2397 | |
| 2398 | Providing --mail-rcpt-allowfails multiple times has no extra effect. |
| 2399 | Disable it again with --no-mail-rcpt-allowfails. |
| 2400 | |
| 2401 | Example: |
| 2402 | .nf |
| 2403 | curl --mail-rcpt-allowfails --mail-rcpt dest@example.com smtp://example.com |
| 2404 | .fi |
| 2405 | |
| 2406 | See also \fI--mail-rcpt\fP. Added in 7.69.0. |
| 2407 | .IP "\-\-mail-rcpt <address>" |
| 2408 | (SMTP) Specify a single email address, user name or mailing list name. Repeat this |
| 2409 | option several times to send to multiple recipients. |
| 2410 | |
| 2411 | When performing an address verification (VRFY command), the recipient should be |
| 2412 | specified as the user name or user name and domain (as per Section 3.5 of |
| 2413 | RFC5321). (Added in 7.34.0) |
| 2414 | |
| 2415 | When performing a mailing list expand (EXPN command), the recipient should be |
| 2416 | specified using the mailing list name, such as "Friends" or "London-Office". |
| 2417 | (Added in 7.34.0) |
| 2418 | |
| 2419 | --mail-rcpt can be used several times in a command line |
| 2420 | |
| 2421 | Example: |
| 2422 | .nf |
| 2423 | curl --mail-rcpt user@example.net smtp://example.com |
| 2424 | .fi |
| 2425 | |
| 2426 | See also \fI--mail-rcpt-allowfails\fP. |
| 2427 | .IP "\-M, \-\-manual" |
| 2428 | Manual. Display the huge help text. |
| 2429 | |
| 2430 | Providing --manual multiple times has no extra effect. |
| 2431 | Disable it again with --no-manual. |
| 2432 | |
| 2433 | Example: |
| 2434 | .nf |
| 2435 | curl --manual |
| 2436 | .fi |
| 2437 | |
| 2438 | See also \fI-v, --verbose\fP, \fI--libcurl\fP and \fI--trace\fP. |
| 2439 | .IP "\-\-max-filesize <bytes>" |
| 2440 | (FTP HTTP MQTT) Specify the maximum size (in bytes) of a file to download. If the file |
| 2441 | requested is larger than this value, the transfer will not start and curl will |
| 2442 | return with exit code 63. |
| 2443 | |
| 2444 | A size modifier may be used. For example, Appending 'k' or 'K' will count the |
| 2445 | number as kilobytes, 'm' or 'M' makes it megabytes, while 'g' or 'G' makes it |
| 2446 | gigabytes. Examples: 200K, 3m and 1G. (Added in 7.58.0) |
| 2447 | |
| 2448 | \fBNOTE\fP: The file size is not always known prior to download, and for such |
| 2449 | files this option has no effect even if the file transfer ends up being larger |
| 2450 | than this given limit. |
| 2451 | If --max-filesize is provided several times, the last set value will be used. |
| 2452 | |
| 2453 | Example: |
| 2454 | .nf |
| 2455 | curl --max-filesize 100K https://example.com |
| 2456 | .fi |
| 2457 | |
| 2458 | See also \fI--limit-rate\fP. |
| 2459 | .IP "\-\-max-redirs <num>" |
| 2460 | (HTTP) Set maximum number of redirections to follow. When \-\-location is used, to |
| 2461 | prevent curl from following too many redirects, by default, the limit is |
| 2462 | set to 50 redirects. Set this option to \-1 to make it unlimited. |
| 2463 | |
| 2464 | If --max-redirs is provided several times, the last set value will be used. |
| 2465 | |
| 2466 | Example: |
| 2467 | .nf |
| 2468 | curl --max-redirs 3 --location https://example.com |
| 2469 | .fi |
| 2470 | |
| 2471 | See also \fI-L, --location\fP. |
| 2472 | .IP "\-m, \-\-max-time <fractional seconds>" |
| 2473 | Maximum time in seconds that you allow each transfer to take. This is |
| 2474 | useful for preventing your batch jobs from hanging for hours due to slow |
| 2475 | networks or links going down. Since 7.32.0, this option accepts decimal |
| 2476 | values, but the actual timeout will decrease in accuracy as the specified |
| 2477 | timeout increases in decimal precision. |
| 2478 | |
| 2479 | If you enable retrying the transfer (\fI\-\-retry\fP) then the maximum time counter is |
| 2480 | reset each time the transfer is retried. You can use \-\-retry-max-time to limit |
| 2481 | the retry time. |
| 2482 | |
| 2483 | If --max-time is provided several times, the last set value will be used. |
| 2484 | |
| 2485 | Examples: |
| 2486 | .nf |
| 2487 | curl --max-time 10 https://example.com |
| 2488 | curl --max-time 2.92 https://example.com |
| 2489 | .fi |
| 2490 | |
| 2491 | See also \fI--connect-timeout\fP and \fI--retry-max-time\fP. |
| 2492 | .IP "\-\-metalink" |
| 2493 | This option was previously used to specify a metalink resource. Metalink |
| 2494 | support has been disabled in curl since 7.78.0 for security reasons. |
| 2495 | |
| 2496 | If --metalink is provided several times, the last set value will be used. |
| 2497 | |
| 2498 | Example: |
| 2499 | .nf |
| 2500 | curl --metalink file https://example.com |
| 2501 | .fi |
| 2502 | |
| 2503 | See also \fI-Z, --parallel\fP. |
| 2504 | .IP "\-\-negotiate" |
| 2505 | (HTTP) Enables Negotiate (SPNEGO) authentication. |
| 2506 | |
| 2507 | This option requires a library built with GSS-API or SSPI support. Use |
| 2508 | \-\-version to see if your curl supports GSS-API/SSPI or SPNEGO. |
| 2509 | |
| 2510 | When using this option, you must also provide a fake \-\-user option to activate |
| 2511 | the authentication code properly. Sending a '-u :' is enough as the user name |
| 2512 | and password from the \-\-user option are not actually used. |
| 2513 | |
| 2514 | If this option is used several times, only the first one is used. |
| 2515 | |
| 2516 | Providing --negotiate multiple times has no extra effect. |
| 2517 | |
| 2518 | Example: |
| 2519 | .nf |
| 2520 | curl --negotiate -u : https://example.com |
| 2521 | .fi |
| 2522 | |
| 2523 | See also \fI--basic\fP, \fI--ntlm\fP, \fI--anyauth\fP and \fI--proxy-negotiate\fP. |
| 2524 | .IP "\-\-netrc-file <filename>" |
| 2525 | This option is similar to \fI\-n, \-\-netrc\fP, except that you provide the path (absolute |
| 2526 | or relative) to the netrc file that curl should use. You can only specify one |
| 2527 | netrc file per invocation. |
| 2528 | |
| 2529 | It will abide by \-\-netrc-optional if specified. |
| 2530 | |
| 2531 | If --netrc-file is provided several times, the last set value will be used. |
| 2532 | |
| 2533 | Example: |
| 2534 | .nf |
| 2535 | curl --netrc-file netrc https://example.com |
| 2536 | .fi |
| 2537 | |
| 2538 | See also \fI-n, --netrc\fP, \fI-u, --user\fP and \fI-K, --config\fP. This option is mutually exclusive to \fI-n, --netrc\fP. |
| 2539 | .IP "\-\-netrc-optional" |
| 2540 | Similar to \fI\-n, \-\-netrc\fP, but this option makes the .netrc usage \fBoptional\fP |
| 2541 | and not mandatory as the \-\-netrc option does. |
| 2542 | |
| 2543 | Providing --netrc-optional multiple times has no extra effect. |
| 2544 | Disable it again with --no-netrc-optional. |
| 2545 | |
| 2546 | Example: |
| 2547 | .nf |
| 2548 | curl --netrc-optional https://example.com |
| 2549 | .fi |
| 2550 | |
| 2551 | See also \fI--netrc-file\fP. This option is mutually exclusive to \fI-n, --netrc\fP. |
| 2552 | .IP "\-n, \-\-netrc" |
| 2553 | Makes curl scan the \fI.netrc\fP (\fI_netrc\fP on Windows) file in the user's home |
| 2554 | directory for login name and password. This is typically used for FTP on |
| 2555 | Unix. If used with HTTP, curl will enable user authentication. See |
| 2556 | \fInetrc(5)\fP and \fIftp(1)\fP for details on the file format. Curl will not |
| 2557 | complain if that file does not have the right permissions (it should be |
| 2558 | neither world- nor group-readable). The environment variable "HOME" is used |
| 2559 | to find the home directory. |
| 2560 | |
| 2561 | A quick and simple example of how to setup a \fI.netrc\fP to allow curl to FTP to |
| 2562 | the machine host.domain.com with user name 'myself' and password 'secret' |
| 2563 | could look similar to: |
| 2564 | |
| 2565 | .nf |
| 2566 | machine host.domain.com |
| 2567 | login myself |
| 2568 | password secret |
| 2569 | .fi |
| 2570 | |
| 2571 | Providing --netrc multiple times has no extra effect. |
| 2572 | Disable it again with --no-netrc. |
| 2573 | |
| 2574 | Example: |
| 2575 | .nf |
| 2576 | curl --netrc https://example.com |
| 2577 | .fi |
| 2578 | |
| 2579 | See also \fI--netrc-file\fP, \fI-K, --config\fP and \fI-u, --user\fP. |
| 2580 | .IP "\-:, \-\-next" |
| 2581 | Tells curl to use a separate operation for the following URL and associated |
| 2582 | options. This allows you to send several URL requests, each with their own |
| 2583 | specific options, for example, such as different user names or custom requests |
| 2584 | for each. |
| 2585 | |
| 2586 | \-\-next will reset all local options and only global ones will have their |
| 2587 | values survive over to the operation following the \-\-next instruction. Global |
| 2588 | options include \fI\-v, \-\-verbose\fP, \fI\-\-trace\fP, \-\-trace-ascii and \fI\-\-fail-early\fP. |
| 2589 | |
| 2590 | For example, you can do both a GET and a POST in a single command line: |
| 2591 | |
| 2592 | .nf |
| 2593 | curl www1.example.com \-\-next \-d postthis www2.example.com |
| 2594 | .fi |
| 2595 | |
| 2596 | --next can be used several times in a command line |
| 2597 | |
| 2598 | Examples: |
| 2599 | .nf |
| 2600 | curl https://example.com --next -d postthis www2.example.com |
| 2601 | curl -I https://example.com --next https://example.net/ |
| 2602 | .fi |
| 2603 | |
| 2604 | See also \fI-Z, --parallel\fP and \fI-K, --config\fP. Added in 7.36.0. |
| 2605 | .IP "\-\-no-alpn" |
| 2606 | (HTTPS) Disable the ALPN TLS extension. ALPN is enabled by default if libcurl was built |
| 2607 | with an SSL library that supports ALPN. ALPN is used by a libcurl that supports |
| 2608 | HTTP/2 to negotiate HTTP/2 support with the server during https sessions. |
| 2609 | |
| 2610 | Providing --no-alpn multiple times has no extra effect. |
| 2611 | Disable it again with --alpn. |
| 2612 | |
| 2613 | Example: |
| 2614 | .nf |
| 2615 | curl --no-alpn https://example.com |
| 2616 | .fi |
| 2617 | |
| 2618 | See also \fI--no-npn\fP and \fI--http2\fP. \fI--no-alpn\fP requires that the underlying libcurl was built to support TLS. Added in 7.36.0. |
| 2619 | .IP "\-N, \-\-no-buffer" |
| 2620 | Disables the buffering of the output stream. In normal work situations, curl |
| 2621 | will use a standard buffered output stream that will have the effect that it |
| 2622 | will output the data in chunks, not necessarily exactly when the data arrives. |
| 2623 | Using this option will disable that buffering. |
| 2624 | |
| 2625 | Providing --no-buffer multiple times has no extra effect. |
| 2626 | Disable it again with --buffer. |
| 2627 | |
| 2628 | Example: |
| 2629 | .nf |
| 2630 | curl --no-buffer https://example.com |
| 2631 | .fi |
| 2632 | |
| 2633 | See also \fI-#, --progress-bar\fP. |
| 2634 | .IP "\-\-no-clobber" |
| 2635 | When used in conjunction with the \fI\-o, \-\-output\fP, \fI\-J, \-\-remote-header-name\fP, |
| 2636 | \fI\-O, \-\-remote-name\fP, or \-\-remote-name-all options, curl avoids overwriting files |
| 2637 | that already exist. Instead, a dot and a number gets appended to the name |
| 2638 | of the file that would be created, up to filename.100 after which it will not |
| 2639 | create any file. |
| 2640 | |
| 2641 | Note that this is the negated option name documented. You can thus use |
| 2642 | \-\-clobber to enforce the clobbering, even if \-\-remote-header-name or \-J is |
| 2643 | specified. |
| 2644 | |
| 2645 | Providing --no-clobber multiple times has no extra effect. |
| 2646 | Disable it again with --clobber. |
| 2647 | |
| 2648 | Example: |
| 2649 | .nf |
| 2650 | curl --no-clobber --output local/dir/file https://example.com |
| 2651 | .fi |
| 2652 | |
| 2653 | See also \fI-o, --output\fP and \fI-O, --remote-name\fP. Added in 7.83.0. |
| 2654 | .IP "\-\-no-keepalive" |
| 2655 | Disables the use of keepalive messages on the TCP connection. curl otherwise |
| 2656 | enables them by default. |
| 2657 | |
| 2658 | Note that this is the negated option name documented. You can thus use |
| 2659 | \-\-keepalive to enforce keepalive. |
| 2660 | |
| 2661 | Providing --no-keepalive multiple times has no extra effect. |
| 2662 | Disable it again with --keepalive. |
| 2663 | |
| 2664 | Example: |
| 2665 | .nf |
| 2666 | curl --no-keepalive https://example.com |
| 2667 | .fi |
| 2668 | |
| 2669 | See also \fI--keepalive-time\fP. |
| 2670 | .IP "\-\-no-npn" |
| 2671 | (HTTPS) In curl 7.86.0 and later, curl never uses NPN. |
| 2672 | |
| 2673 | Disable the NPN TLS extension. NPN is enabled by default if libcurl was built |
| 2674 | with an SSL library that supports NPN. NPN is used by a libcurl that supports |
| 2675 | HTTP/2 to negotiate HTTP/2 support with the server during https sessions. |
| 2676 | |
| 2677 | Providing --no-npn multiple times has no extra effect. |
| 2678 | Disable it again with --npn. |
| 2679 | |
| 2680 | Example: |
| 2681 | .nf |
| 2682 | curl --no-npn https://example.com |
| 2683 | .fi |
| 2684 | |
| 2685 | See also \fI--no-alpn\fP and \fI--http2\fP. \fI--no-npn\fP requires that the underlying libcurl was built to support TLS. Added in 7.36.0. |
| 2686 | .IP "\-\-no-progress-meter" |
| 2687 | Option to switch off the progress meter output without muting or otherwise |
| 2688 | affecting warning and informational messages like \-\-silent does. |
| 2689 | |
| 2690 | Note that this is the negated option name documented. You can thus use |
| 2691 | \-\-progress-meter to enable the progress meter again. |
| 2692 | |
| 2693 | Providing --no-progress-meter multiple times has no extra effect. |
| 2694 | Disable it again with --progress-meter. |
| 2695 | |
| 2696 | Example: |
| 2697 | .nf |
| 2698 | curl --no-progress-meter -o store https://example.com |
| 2699 | .fi |
| 2700 | |
| 2701 | See also \fI-v, --verbose\fP and \fI-s, --silent\fP. Added in 7.67.0. |
| 2702 | .IP "\-\-no-sessionid" |
| 2703 | (TLS) Disable curl's use of SSL session-ID caching. By default all transfers are |
| 2704 | done using the cache. Note that while nothing should ever get hurt by |
| 2705 | attempting to reuse SSL session-IDs, there seem to be broken SSL |
| 2706 | implementations in the wild that may require you to disable this in order for |
| 2707 | you to succeed. |
| 2708 | |
| 2709 | Note that this is the negated option name documented. You can thus use |
| 2710 | \-\-sessionid to enforce session-ID caching. |
| 2711 | |
| 2712 | Providing --no-sessionid multiple times has no extra effect. |
| 2713 | Disable it again with --sessionid. |
| 2714 | |
| 2715 | Example: |
| 2716 | .nf |
| 2717 | curl --no-sessionid https://example.com |
| 2718 | .fi |
| 2719 | |
| 2720 | See also \fI-k, --insecure\fP. |
| 2721 | .IP "\-\-noproxy <no-proxy-list>" |
| 2722 | Comma-separated list of hosts for which not to use a proxy, if one is |
| 2723 | specified. The only wildcard is a single * character, which matches all hosts, |
| 2724 | and effectively disables the proxy. Each name in this list is matched as |
| 2725 | either a domain which contains the hostname, or the hostname itself. For |
| 2726 | example, local.com would match local.com, local.com:80, and www.local.com, but |
| 2727 | not www.notlocal.com. |
| 2728 | |
| 2729 | Since 7.53.0, This option overrides the environment variables that disable the |
| 2730 | proxy ('no_proxy' and 'NO_PROXY'). If there's an environment variable |
| 2731 | disabling a proxy, you can set the noproxy list to "" to override it. |
| 2732 | |
| 2733 | If --noproxy is provided several times, the last set value will be used. |
| 2734 | |
| 2735 | Example: |
| 2736 | .nf |
| 2737 | curl --noproxy "www.example" https://example.com |
| 2738 | .fi |
| 2739 | |
| 2740 | See also \fI-x, --proxy\fP. |
| 2741 | .IP "\-\-ntlm-wb" |
| 2742 | (HTTP) Enables NTLM much in the style \-\-ntlm does, but hand over the authentication |
| 2743 | to the separate binary ntlmauth application that is executed when needed. |
| 2744 | |
| 2745 | Providing --ntlm-wb multiple times has no extra effect. |
| 2746 | |
| 2747 | Example: |
| 2748 | .nf |
| 2749 | curl --ntlm-wb -u user:password https://example.com |
| 2750 | .fi |
| 2751 | |
| 2752 | See also \fI--ntlm\fP and \fI--proxy-ntlm\fP. |
| 2753 | .IP "\-\-ntlm" |
| 2754 | (HTTP) Enables NTLM authentication. The NTLM authentication method was designed by |
| 2755 | Microsoft and is used by IIS web servers. It is a proprietary protocol, |
| 2756 | reverse-engineered by clever people and implemented in curl based on their |
| 2757 | efforts. This kind of behavior should not be endorsed, you should encourage |
| 2758 | everyone who uses NTLM to switch to a public and documented authentication |
| 2759 | method instead, such as Digest. |
| 2760 | |
| 2761 | If you want to enable NTLM for your proxy authentication, then use |
| 2762 | \fI\-\-proxy-ntlm\fP. |
| 2763 | |
| 2764 | If this option is used several times, only the first one is used. |
| 2765 | |
| 2766 | Providing --ntlm multiple times has no extra effect. |
| 2767 | |
| 2768 | Example: |
| 2769 | .nf |
| 2770 | curl --ntlm -u user:password https://example.com |
| 2771 | .fi |
| 2772 | |
| 2773 | See also \fI--proxy-ntlm\fP. \fI--ntlm\fP requires that the underlying libcurl was built to support TLS. This option is mutually exclusive to \fI--basic\fP and \fI--negotiate\fP and \fI--digest\fP and \fI--anyauth\fP. |
| 2774 | .IP "\-\-oauth2-bearer <token>" |
| 2775 | (IMAP LDAP POP3 SMTP HTTP) Specify the Bearer Token for OAUTH 2.0 server authentication. The Bearer Token |
| 2776 | is used in conjunction with the user name which can be specified as part of |
| 2777 | the \-\-url or \-\-user options. |
| 2778 | |
| 2779 | The Bearer Token and user name are formatted according to RFC 6750. |
| 2780 | |
| 2781 | If --oauth2-bearer is provided several times, the last set value will be used. |
| 2782 | |
| 2783 | Example: |
| 2784 | .nf |
| 2785 | curl --oauth2-bearer "mF_9.B5f-4.1JqM" https://example.com |
| 2786 | .fi |
| 2787 | |
| 2788 | See also \fI--basic\fP, \fI--ntlm\fP and \fI--digest\fP. Added in 7.33.0. |
| 2789 | .IP "\-\-output-dir <dir>" |
| 2790 | This option specifies the directory in which files should be stored, when |
| 2791 | \-\-remote-name or \-\-output are used. |
| 2792 | |
| 2793 | The given output directory is used for all URLs and output options on the |
| 2794 | command line, up until the first \fI\-:, \-\-next\fP. |
| 2795 | |
| 2796 | If the specified target directory does not exist, the operation will fail |
| 2797 | unless \-\-create-dirs is also used. |
| 2798 | |
| 2799 | If --output-dir is provided several times, the last set value will be used. |
| 2800 | |
| 2801 | Example: |
| 2802 | .nf |
| 2803 | curl --output-dir "tmp" -O https://example.com |
| 2804 | .fi |
| 2805 | |
| 2806 | See also \fI-O, --remote-name\fP and \fI-J, --remote-header-name\fP. Added in 7.73.0. |
| 2807 | .IP "\-o, \-\-output <file>" |
| 2808 | Write output to <file> instead of stdout. If you are using {} or [] to fetch |
| 2809 | multiple documents, you should quote the URL and you can use '#' followed by a |
| 2810 | number in the <file> specifier. That variable will be replaced with the current |
| 2811 | string for the URL being fetched. Like in: |
| 2812 | |
| 2813 | .nf |
| 2814 | curl "http://{one,two}.example.com" \-o "file_#1.txt" |
| 2815 | .fi |
| 2816 | |
| 2817 | or use several variables like: |
| 2818 | |
| 2819 | .nf |
| 2820 | curl "http://{site,host}.host[1-5].com" \-o "#1_#2" |
| 2821 | .fi |
| 2822 | |
| 2823 | You may use this option as many times as the number of URLs you have. For |
| 2824 | example, if you specify two URLs on the same command line, you can use it like |
| 2825 | this: |
| 2826 | |
| 2827 | .nf |
| 2828 | curl \-o aa example.com \-o bb example.net |
| 2829 | .fi |
| 2830 | |
| 2831 | and the order of the \-o options and the URLs does not matter, just that the |
| 2832 | first \-o is for the first URL and so on, so the above command line can also be |
| 2833 | written as |
| 2834 | |
| 2835 | .nf |
| 2836 | curl example.com example.net \-o aa \-o bb |
| 2837 | .fi |
| 2838 | |
| 2839 | See also the \-\-create-dirs option to create the local directories |
| 2840 | dynamically. Specifying the output as '-' (a single dash) will force the |
| 2841 | output to be done to stdout. |
| 2842 | |
| 2843 | To suppress response bodies, you can redirect output to /dev/null: |
| 2844 | |
| 2845 | .nf |
| 2846 | curl example.com \-o /dev/null |
| 2847 | .fi |
| 2848 | |
| 2849 | Or for Windows use nul: |
| 2850 | |
| 2851 | .nf |
| 2852 | curl example.com \-o nul |
| 2853 | .fi |
| 2854 | |
| 2855 | --output can be used several times in a command line |
| 2856 | |
| 2857 | Examples: |
| 2858 | .nf |
| 2859 | curl -o file https://example.com |
| 2860 | curl "http://{one,two}.example.com" -o "file_#1.txt" |
| 2861 | curl "http://{site,host}.host[1-5].com" -o "#1_#2" |
| 2862 | curl -o file https://example.com -o file2 https://example.net |
| 2863 | .fi |
| 2864 | |
| 2865 | See also \fI-O, --remote-name\fP, \fI--remote-name-all\fP and \fI-J, --remote-header-name\fP. |
| 2866 | .IP "\-\-parallel-immediate" |
| 2867 | When doing parallel transfers, this option will instruct curl that it should |
| 2868 | rather prefer opening up more connections in parallel at once rather than |
| 2869 | waiting to see if new transfers can be added as multiplexed streams on another |
| 2870 | connection. |
| 2871 | |
| 2872 | This option is global and does not need to be specified for each use of |
| 2873 | \fI\-:, \-\-next\fP. |
| 2874 | |
| 2875 | Providing --parallel-immediate multiple times has no extra effect. |
| 2876 | Disable it again with --no-parallel-immediate. |
| 2877 | |
| 2878 | Example: |
| 2879 | .nf |
| 2880 | curl --parallel-immediate -Z https://example.com -o file1 https://example.com -o file2 |
| 2881 | .fi |
| 2882 | |
| 2883 | See also \fI-Z, --parallel\fP and \fI--parallel-max\fP. Added in 7.68.0. |
| 2884 | .IP "\-\-parallel-max <num>" |
| 2885 | When asked to do parallel transfers, using \fI\-Z, \-\-parallel\fP, this option controls |
| 2886 | the maximum amount of transfers to do simultaneously. |
| 2887 | |
| 2888 | This option is global and does not need to be specified for each use of |
| 2889 | \fI\-:, \-\-next\fP. |
| 2890 | |
| 2891 | The default is 50. |
| 2892 | |
| 2893 | If --parallel-max is provided several times, the last set value will be used. |
| 2894 | |
| 2895 | Example: |
| 2896 | .nf |
| 2897 | curl --parallel-max 100 -Z https://example.com ftp://example.com/ |
| 2898 | .fi |
| 2899 | |
| 2900 | See also \fI-Z, --parallel\fP. Added in 7.66.0. |
| 2901 | .IP "\-Z, \-\-parallel" |
| 2902 | Makes curl perform its transfers in parallel as compared to the regular serial |
| 2903 | manner. |
| 2904 | |
| 2905 | This option is global and does not need to be specified for each use of |
| 2906 | \fI\-:, \-\-next\fP. |
| 2907 | |
| 2908 | Providing --parallel multiple times has no extra effect. |
| 2909 | Disable it again with --no-parallel. |
| 2910 | |
| 2911 | Example: |
| 2912 | .nf |
| 2913 | curl --parallel https://example.com -o file1 https://example.com -o file2 |
| 2914 | .fi |
| 2915 | |
| 2916 | See also \fI-:, --next\fP and \fI-v, --verbose\fP. Added in 7.66.0. |
| 2917 | .IP "\-\-pass <phrase>" |
| 2918 | (SSH TLS) Passphrase for the private key. |
| 2919 | |
| 2920 | If --pass is provided several times, the last set value will be used. |
| 2921 | |
| 2922 | Example: |
| 2923 | .nf |
| 2924 | curl --pass secret --key file https://example.com |
| 2925 | .fi |
| 2926 | |
| 2927 | See also \fI--key\fP and \fI-u, --user\fP. |
| 2928 | .IP "\-\-path-as-is" |
| 2929 | Tell curl to not handle sequences of /../ or /./ in the given URL |
| 2930 | path. Normally curl will squash or merge them according to standards but with |
| 2931 | this option set you tell it not to do that. |
| 2932 | |
| 2933 | Providing --path-as-is multiple times has no extra effect. |
| 2934 | Disable it again with --no-path-as-is. |
| 2935 | |
| 2936 | Example: |
| 2937 | .nf |
| 2938 | curl --path-as-is https://example.com/../../etc/passwd |
| 2939 | .fi |
| 2940 | |
| 2941 | See also \fI--request-target\fP. Added in 7.42.0. |
| 2942 | .IP "\-\-pinnedpubkey <hashes>" |
| 2943 | (TLS) Tells curl to use the specified public key file (or hashes) to verify the |
| 2944 | peer. This can be a path to a file which contains a single public key in PEM |
| 2945 | or DER format, or any number of base64 encoded sha256 hashes preceded by |
| 2946 | \(aqsha256//' and separated by ';'. |
| 2947 | |
| 2948 | When negotiating a TLS or SSL connection, the server sends a certificate |
| 2949 | indicating its identity. A public key is extracted from this certificate and |
| 2950 | if it does not exactly match the public key provided to this option, curl will |
| 2951 | abort the connection before sending or receiving any data. |
| 2952 | |
| 2953 | PEM/DER support: |
| 2954 | |
| 2955 | 7.39.0: OpenSSL, GnuTLS and GSKit |
| 2956 | |
| 2957 | 7.43.0: NSS and wolfSSL |
| 2958 | |
| 2959 | 7.47.0: mbedtls |
| 2960 | |
| 2961 | sha256 support: |
| 2962 | |
| 2963 | 7.44.0: OpenSSL, GnuTLS, NSS and wolfSSL |
| 2964 | |
| 2965 | 7.47.0: mbedtls |
| 2966 | |
| 2967 | Other SSL backends not supported. |
| 2968 | |
| 2969 | If --pinnedpubkey is provided several times, the last set value will be used. |
| 2970 | |
| 2971 | Examples: |
| 2972 | .nf |
| 2973 | curl --pinnedpubkey keyfile https://example.com |
| 2974 | curl --pinnedpubkey 'sha256//ce118b51897f4452dc' https://example.com |
| 2975 | .fi |
| 2976 | |
| 2977 | See also \fI--hostpubsha256\fP. Added in 7.39.0. |
| 2978 | .IP "\-\-post301" |
| 2979 | (HTTP) Tells curl to respect RFC 7231/6.4.2 and not convert POST requests into GET |
| 2980 | requests when following a 301 redirection. The non-RFC behavior is ubiquitous |
| 2981 | in web browsers, so curl does the conversion by default to maintain |
| 2982 | consistency. However, a server may require a POST to remain a POST after such |
| 2983 | a redirection. This option is meaningful only when using \fI\-L, \-\-location\fP. |
| 2984 | |
| 2985 | Providing --post301 multiple times has no extra effect. |
| 2986 | Disable it again with --no-post301. |
| 2987 | |
| 2988 | Example: |
| 2989 | .nf |
| 2990 | curl --post301 --location -d "data" https://example.com |
| 2991 | .fi |
| 2992 | |
| 2993 | See also \fI--post302\fP, \fI--post303\fP and \fI-L, --location\fP. |
| 2994 | .IP "\-\-post302" |
| 2995 | (HTTP) Tells curl to respect RFC 7231/6.4.3 and not convert POST requests into GET |
| 2996 | requests when following a 302 redirection. The non-RFC behavior is ubiquitous |
| 2997 | in web browsers, so curl does the conversion by default to maintain |
| 2998 | consistency. However, a server may require a POST to remain a POST after such |
| 2999 | a redirection. This option is meaningful only when using \fI\-L, \-\-location\fP. |
| 3000 | |
| 3001 | Providing --post302 multiple times has no extra effect. |
| 3002 | Disable it again with --no-post302. |
| 3003 | |
| 3004 | Example: |
| 3005 | .nf |
| 3006 | curl --post302 --location -d "data" https://example.com |
| 3007 | .fi |
| 3008 | |
| 3009 | See also \fI--post301\fP, \fI--post303\fP and \fI-L, --location\fP. |
| 3010 | .IP "\-\-post303" |
| 3011 | (HTTP) Tells curl to violate RFC 7231/6.4.4 and not convert POST requests into GET |
| 3012 | requests when following 303 redirections. A server may require a POST to |
| 3013 | remain a POST after a 303 redirection. This option is meaningful only when |
| 3014 | using \fI\-L, \-\-location\fP. |
| 3015 | |
| 3016 | Providing --post303 multiple times has no extra effect. |
| 3017 | Disable it again with --no-post303. |
| 3018 | |
| 3019 | Example: |
| 3020 | .nf |
| 3021 | curl --post303 --location -d "data" https://example.com |
| 3022 | .fi |
| 3023 | |
| 3024 | See also \fI--post302\fP, \fI--post301\fP and \fI-L, --location\fP. |
| 3025 | .IP "\-\-preproxy [protocol://]host[:port]" |
| 3026 | Use the specified SOCKS proxy before connecting to an HTTP or HTTPS \fI\-x, \-\-proxy\fP. In |
| 3027 | such a case curl first connects to the SOCKS proxy and then connects (through |
| 3028 | SOCKS) to the HTTP or HTTPS proxy. Hence pre proxy. |
| 3029 | |
| 3030 | The pre proxy string should be specified with a protocol:// prefix to specify |
| 3031 | alternative proxy protocols. Use socks4://, socks4a://, socks5:// or |
| 3032 | socks5h:// to request the specific SOCKS version to be used. No protocol |
| 3033 | specified will make curl default to SOCKS4. |
| 3034 | |
| 3035 | If the port number is not specified in the proxy string, it is assumed to be |
| 3036 | 1080. |
| 3037 | |
| 3038 | User and password that might be provided in the proxy string are URL decoded |
| 3039 | by curl. This allows you to pass in special characters such as @ by using %40 |
| 3040 | or pass in a colon with %3a. |
| 3041 | |
| 3042 | If --preproxy is provided several times, the last set value will be used. |
| 3043 | |
| 3044 | Example: |
| 3045 | .nf |
| 3046 | curl --preproxy socks5://proxy.example -x http://http.example https://example.com |
| 3047 | .fi |
| 3048 | |
| 3049 | See also \fI-x, --proxy\fP and \fI--socks5\fP. Added in 7.52.0. |
| 3050 | .IP "\-#, \-\-progress-bar" |
| 3051 | Make curl display transfer progress as a simple progress bar instead of the |
| 3052 | standard, more informational, meter. |
| 3053 | |
| 3054 | This progress bar draws a single line of '#' characters across the screen and |
| 3055 | shows a percentage if the transfer size is known. For transfers without a |
| 3056 | known size, there will be space ship (-=o=-) that moves back and forth but |
| 3057 | only while data is being transferred, with a set of flying hash sign symbols on |
| 3058 | top. |
| 3059 | |
| 3060 | This option is global and does not need to be specified for each use of |
| 3061 | \fI\-:, \-\-next\fP. |
| 3062 | |
| 3063 | Providing --progress-bar multiple times has no extra effect. |
| 3064 | Disable it again with --no-progress-bar. |
| 3065 | |
| 3066 | Example: |
| 3067 | .nf |
| 3068 | curl -# -O https://example.com |
| 3069 | .fi |
| 3070 | |
| 3071 | See also \fI--styled-output\fP. |
| 3072 | .IP "\-\-proto-default <protocol>" |
| 3073 | Tells curl to use \fIprotocol\fP for any URL missing a scheme name. |
| 3074 | |
| 3075 | An unknown or unsupported protocol causes error |
| 3076 | \fICURLE_UNSUPPORTED_PROTOCOL\fP (1). |
| 3077 | |
| 3078 | This option does not change the default proxy protocol (http). |
| 3079 | |
| 3080 | Without this option set, curl guesses protocol based on the host name, see |
| 3081 | \-\-url for details. |
| 3082 | |
| 3083 | If --proto-default is provided several times, the last set value will be used. |
| 3084 | |
| 3085 | Example: |
| 3086 | .nf |
| 3087 | curl --proto-default https ftp.example.com |
| 3088 | .fi |
| 3089 | |
| 3090 | See also \fI--proto\fP and \fI--proto-redir\fP. Added in 7.45.0. |
| 3091 | .IP "\-\-proto-redir <protocols>" |
| 3092 | Tells curl to limit what protocols it may use on redirect. Protocols denied by |
| 3093 | \-\-proto are not overridden by this option. See \-\-proto for how protocols are |
| 3094 | represented. |
| 3095 | |
| 3096 | Example, allow only HTTP and HTTPS on redirect: |
| 3097 | |
| 3098 | .nf |
| 3099 | curl \-\-proto-redir \-all,http,https http://example.com |
| 3100 | .fi |
| 3101 | |
| 3102 | By default curl will only allow HTTP, HTTPS, FTP and FTPS on redirect (since |
| 3103 | 7.65.2). Specifying \fIall\fP or \fI+all\fP enables all protocols on redirects, which |
| 3104 | is not good for security. |
| 3105 | |
| 3106 | If --proto-redir is provided several times, the last set value will be used. |
| 3107 | |
| 3108 | Example: |
| 3109 | .nf |
| 3110 | curl --proto-redir =http,https https://example.com |
| 3111 | .fi |
| 3112 | |
| 3113 | See also \fI--proto\fP. |
| 3114 | .IP "\-\-proto <protocols>" |
| 3115 | Tells curl to limit what protocols it may use for transfers. Protocols are |
| 3116 | evaluated left to right, are comma separated, and are each a protocol name or |
| 3117 | \(aqall', optionally prefixed by zero or more modifiers. Available modifiers are: |
| 3118 | .RS |
| 3119 | .TP 3 |
| 3120 | .B + |
| 3121 | Permit this protocol in addition to protocols already permitted (this is |
| 3122 | the default if no modifier is used). |
| 3123 | .TP |
| 3124 | .B \- |
| 3125 | Deny this protocol, removing it from the list of protocols already permitted. |
| 3126 | .TP |
| 3127 | .B = |
| 3128 | Permit only this protocol (ignoring the list already permitted), though |
| 3129 | subject to later modification by subsequent entries in the comma separated |
| 3130 | list. |
| 3131 | .RE |
| 3132 | .IP |
| 3133 | For example: |
| 3134 | .RS |
| 3135 | .TP 15 |
| 3136 | .B \fI\-\-proto\fP \-ftps |
| 3137 | uses the default protocols, but disables ftps |
| 3138 | .TP |
| 3139 | .B \fI\-\-proto\fP \-all,https,+http |
| 3140 | only enables http and https |
| 3141 | .TP |
| 3142 | .B \fI\-\-proto\fP =http,https |
| 3143 | also only enables http and https |
| 3144 | .RE |
| 3145 | .IP |
| 3146 | Unknown and disabled protocols produce a warning. This allows scripts to |
| 3147 | safely rely on being able to disable potentially dangerous protocols, without |
| 3148 | relying upon support for that protocol being built into curl to avoid an error. |
| 3149 | |
| 3150 | This option can be used multiple times, in which case the effect is the same |
| 3151 | as concatenating the protocols into one instance of the option. |
| 3152 | |
| 3153 | If --proto is provided several times, the last set value will be used. |
| 3154 | |
| 3155 | Example: |
| 3156 | .nf |
| 3157 | curl --proto =http,https,sftp https://example.com |
| 3158 | .fi |
| 3159 | |
| 3160 | See also \fI--proto-redir\fP and \fI--proto-default\fP. |
| 3161 | .IP "\-\-proxy-anyauth" |
| 3162 | Tells curl to pick a suitable authentication method when communicating with |
| 3163 | the given HTTP proxy. This might cause an extra request/response round-trip. |
| 3164 | |
| 3165 | Providing --proxy-anyauth multiple times has no extra effect. |
| 3166 | |
| 3167 | Example: |
| 3168 | .nf |
| 3169 | curl --proxy-anyauth --proxy-user user:passwd -x proxy https://example.com |
| 3170 | .fi |
| 3171 | |
| 3172 | See also \fI-x, --proxy\fP, \fI--proxy-basic\fP and \fI--proxy-digest\fP. |
| 3173 | .IP "\-\-proxy-basic" |
| 3174 | Tells curl to use HTTP Basic authentication when communicating with the given |
| 3175 | proxy. Use \-\-basic for enabling HTTP Basic with a remote host. Basic is the |
| 3176 | default authentication method curl uses with proxies. |
| 3177 | |
| 3178 | Providing --proxy-basic multiple times has no extra effect. |
| 3179 | |
| 3180 | Example: |
| 3181 | .nf |
| 3182 | curl --proxy-basic --proxy-user user:passwd -x proxy https://example.com |
| 3183 | .fi |
| 3184 | |
| 3185 | See also \fI-x, --proxy\fP, \fI--proxy-anyauth\fP and \fI--proxy-digest\fP. |
| 3186 | .IP "\-\-proxy-cacert <file>" |
| 3187 | Same as \-\-cacert but used in HTTPS proxy context. |
| 3188 | |
| 3189 | If --proxy-cacert is provided several times, the last set value will be used. |
| 3190 | |
| 3191 | Example: |
| 3192 | .nf |
| 3193 | curl --proxy-cacert CA-file.txt -x https://proxy https://example.com |
| 3194 | .fi |
| 3195 | |
| 3196 | See also \fI--proxy-capath\fP, \fI--cacert\fP, \fI--capath\fP and \fI-x, --proxy\fP. Added in 7.52.0. |
| 3197 | .IP "\-\-proxy-capath <dir>" |
| 3198 | Same as \-\-capath but used in HTTPS proxy context. |
| 3199 | |
| 3200 | If --proxy-capath is provided several times, the last set value will be used. |
| 3201 | |
| 3202 | Example: |
| 3203 | .nf |
| 3204 | curl --proxy-capath /local/directory -x https://proxy https://example.com |
| 3205 | .fi |
| 3206 | |
| 3207 | See also \fI--proxy-cacert\fP, \fI-x, --proxy\fP and \fI--capath\fP. Added in 7.52.0. |
| 3208 | .IP "\-\-proxy-cert-type <type>" |
| 3209 | Same as \-\-cert-type but used in HTTPS proxy context. |
| 3210 | |
| 3211 | If --proxy-cert-type is provided several times, the last set value will be used. |
| 3212 | |
| 3213 | Example: |
| 3214 | .nf |
| 3215 | curl --proxy-cert-type PEM --proxy-cert file -x https://proxy https://example.com |
| 3216 | .fi |
| 3217 | |
| 3218 | See also \fI--proxy-cert\fP. Added in 7.52.0. |
| 3219 | .IP "\-\-proxy-cert <cert[:passwd]>" |
| 3220 | Same as \-\-cert but used in HTTPS proxy context. |
| 3221 | |
| 3222 | If --proxy-cert is provided several times, the last set value will be used. |
| 3223 | |
| 3224 | Example: |
| 3225 | .nf |
| 3226 | curl --proxy-cert file -x https://proxy https://example.com |
| 3227 | .fi |
| 3228 | |
| 3229 | See also \fI--proxy-cert-type\fP. Added in 7.52.0. |
| 3230 | .IP "\-\-proxy-ciphers <list>" |
| 3231 | Same as \-\-ciphers but used in HTTPS proxy context. |
| 3232 | |
| 3233 | If --proxy-ciphers is provided several times, the last set value will be used. |
| 3234 | |
| 3235 | Example: |
| 3236 | .nf |
| 3237 | curl --proxy-ciphers ECDHE-ECDSA-AES256-CCM8 -x https://proxy https://example.com |
| 3238 | .fi |
| 3239 | |
| 3240 | See also \fI--ciphers\fP, \fI--curves\fP and \fI-x, --proxy\fP. Added in 7.52.0. |
| 3241 | .IP "\-\-proxy-crlfile <file>" |
| 3242 | Same as \-\-crlfile but used in HTTPS proxy context. |
| 3243 | |
| 3244 | If --proxy-crlfile is provided several times, the last set value will be used. |
| 3245 | |
| 3246 | Example: |
| 3247 | .nf |
| 3248 | curl --proxy-crlfile rejects.txt -x https://proxy https://example.com |
| 3249 | .fi |
| 3250 | |
| 3251 | See also \fI--crlfile\fP and \fI-x, --proxy\fP. Added in 7.52.0. |
| 3252 | .IP "\-\-proxy-digest" |
| 3253 | Tells curl to use HTTP Digest authentication when communicating with the given |
| 3254 | proxy. Use \-\-digest for enabling HTTP Digest with a remote host. |
| 3255 | |
| 3256 | Providing --proxy-digest multiple times has no extra effect. |
| 3257 | |
| 3258 | Example: |
| 3259 | .nf |
| 3260 | curl --proxy-digest --proxy-user user:passwd -x proxy https://example.com |
| 3261 | .fi |
| 3262 | |
| 3263 | See also \fI-x, --proxy\fP, \fI--proxy-anyauth\fP and \fI--proxy-basic\fP. |
| 3264 | .IP "\-\-proxy-header <header/@file>" |
| 3265 | (HTTP) Extra header to include in the request when sending HTTP to a proxy. You may |
| 3266 | specify any number of extra headers. This is the equivalent option to \-\-header |
| 3267 | but is for proxy communication only like in CONNECT requests when you want a |
| 3268 | separate header sent to the proxy to what is sent to the actual remote host. |
| 3269 | |
| 3270 | curl will make sure that each header you add/replace is sent with the proper |
| 3271 | end-of-line marker, you should thus \fBnot\fP add that as a part of the header |
| 3272 | content: do not add newlines or carriage returns, they will only mess things |
| 3273 | up for you. |
| 3274 | |
| 3275 | Headers specified with this option will not be included in requests that curl |
| 3276 | knows will not be sent to a proxy. |
| 3277 | |
| 3278 | Starting in 7.55.0, this option can take an argument in @filename style, which |
| 3279 | then adds a header for each line in the input file. Using @- will make curl |
| 3280 | read the header file from stdin. |
| 3281 | |
| 3282 | This option can be used multiple times to add/replace/remove multiple headers. |
| 3283 | |
| 3284 | --proxy-header can be used several times in a command line |
| 3285 | |
| 3286 | Examples: |
| 3287 | .nf |
| 3288 | curl --proxy-header "X-First-Name: Joe" -x http://proxy https://example.com |
| 3289 | curl --proxy-header "User-Agent: surprise" -x http://proxy https://example.com |
| 3290 | curl --proxy-header "Host:" -x http://proxy https://example.com |
| 3291 | .fi |
| 3292 | |
| 3293 | See also \fI-x, --proxy\fP. Added in 7.37.0. |
| 3294 | .IP "\-\-proxy-insecure" |
| 3295 | Same as \-\-insecure but used in HTTPS proxy context. |
| 3296 | |
| 3297 | Providing --proxy-insecure multiple times has no extra effect. |
| 3298 | Disable it again with --no-proxy-insecure. |
| 3299 | |
| 3300 | Example: |
| 3301 | .nf |
| 3302 | curl --proxy-insecure -x https://proxy https://example.com |
| 3303 | .fi |
| 3304 | |
| 3305 | See also \fI-x, --proxy\fP and \fI-k, --insecure\fP. Added in 7.52.0. |
| 3306 | .IP "\-\-proxy-key-type <type>" |
| 3307 | Same as \-\-key-type but used in HTTPS proxy context. |
| 3308 | |
| 3309 | If --proxy-key-type is provided several times, the last set value will be used. |
| 3310 | |
| 3311 | Example: |
| 3312 | .nf |
| 3313 | curl --proxy-key-type DER --proxy-key here -x https://proxy https://example.com |
| 3314 | .fi |
| 3315 | |
| 3316 | See also \fI--proxy-key\fP and \fI-x, --proxy\fP. Added in 7.52.0. |
| 3317 | .IP "\-\-proxy-key <key>" |
| 3318 | Same as \-\-key but used in HTTPS proxy context. |
| 3319 | |
| 3320 | If --proxy-key is provided several times, the last set value will be used. |
| 3321 | |
| 3322 | Example: |
| 3323 | .nf |
| 3324 | curl --proxy-key here -x https://proxy https://example.com |
| 3325 | .fi |
| 3326 | |
| 3327 | See also \fI--proxy-key-type\fP and \fI-x, --proxy\fP. Added in 7.52.0. |
| 3328 | .IP "\-\-proxy-negotiate" |
| 3329 | Tells curl to use HTTP Negotiate (SPNEGO) authentication when communicating |
| 3330 | with the given proxy. Use \-\-negotiate for enabling HTTP Negotiate (SPNEGO) |
| 3331 | with a remote host. |
| 3332 | |
| 3333 | Providing --proxy-negotiate multiple times has no extra effect. |
| 3334 | |
| 3335 | Example: |
| 3336 | .nf |
| 3337 | curl --proxy-negotiate --proxy-user user:passwd -x proxy https://example.com |
| 3338 | .fi |
| 3339 | |
| 3340 | See also \fI--proxy-anyauth\fP and \fI--proxy-basic\fP. |
| 3341 | .IP "\-\-proxy-ntlm" |
| 3342 | Tells curl to use HTTP NTLM authentication when communicating with the given |
| 3343 | proxy. Use \-\-ntlm for enabling NTLM with a remote host. |
| 3344 | |
| 3345 | Providing --proxy-ntlm multiple times has no extra effect. |
| 3346 | |
| 3347 | Example: |
| 3348 | .nf |
| 3349 | curl --proxy-ntlm --proxy-user user:passwd -x http://proxy https://example.com |
| 3350 | .fi |
| 3351 | |
| 3352 | See also \fI--proxy-negotiate\fP and \fI--proxy-anyauth\fP. |
| 3353 | .IP "\-\-proxy-pass <phrase>" |
| 3354 | Same as \-\-pass but used in HTTPS proxy context. |
| 3355 | |
| 3356 | If --proxy-pass is provided several times, the last set value will be used. |
| 3357 | |
| 3358 | Example: |
| 3359 | .nf |
| 3360 | curl --proxy-pass secret --proxy-key here -x https://proxy https://example.com |
| 3361 | .fi |
| 3362 | |
| 3363 | See also \fI-x, --proxy\fP and \fI--proxy-key\fP. Added in 7.52.0. |
| 3364 | .IP "\-\-proxy-pinnedpubkey <hashes>" |
| 3365 | (TLS) Tells curl to use the specified public key file (or hashes) to verify the |
| 3366 | proxy. This can be a path to a file which contains a single public key in PEM |
| 3367 | or DER format, or any number of base64 encoded sha256 hashes preceded by |
| 3368 | \(aqsha256//' and separated by ';'. |
| 3369 | |
| 3370 | When negotiating a TLS or SSL connection, the server sends a certificate |
| 3371 | indicating its identity. A public key is extracted from this certificate and |
| 3372 | if it does not exactly match the public key provided to this option, curl will |
| 3373 | abort the connection before sending or receiving any data. |
| 3374 | |
| 3375 | If --proxy-pinnedpubkey is provided several times, the last set value will be used. |
| 3376 | |
| 3377 | Examples: |
| 3378 | .nf |
| 3379 | curl --proxy-pinnedpubkey keyfile https://example.com |
| 3380 | curl --proxy-pinnedpubkey 'sha256//ce118b51897f4452dc' https://example.com |
| 3381 | .fi |
| 3382 | |
| 3383 | See also \fI--pinnedpubkey\fP and \fI-x, --proxy\fP. Added in 7.59.0. |
| 3384 | .IP "\-\-proxy-service-name <name>" |
| 3385 | This option allows you to change the service name for proxy negotiation. |
| 3386 | |
| 3387 | If --proxy-service-name is provided several times, the last set value will be used. |
| 3388 | |
| 3389 | Example: |
| 3390 | .nf |
| 3391 | curl --proxy-service-name "shrubbery" -x proxy https://example.com |
| 3392 | .fi |
| 3393 | |
| 3394 | See also \fI--service-name\fP and \fI-x, --proxy\fP. Added in 7.43.0. |
| 3395 | .IP "\-\-proxy-ssl-allow-beast" |
| 3396 | Same as \-\-ssl-allow-beast but used in HTTPS proxy context. |
| 3397 | |
| 3398 | Providing --proxy-ssl-allow-beast multiple times has no extra effect. |
| 3399 | Disable it again with --no-proxy-ssl-allow-beast. |
| 3400 | |
| 3401 | Example: |
| 3402 | .nf |
| 3403 | curl --proxy-ssl-allow-beast -x https://proxy https://example.com |
| 3404 | .fi |
| 3405 | |
| 3406 | See also \fI--ssl-allow-beast\fP and \fI-x, --proxy\fP. Added in 7.52.0. |
| 3407 | .IP "\-\-proxy-ssl-auto-client-cert" |
| 3408 | Same as \-\-ssl-auto-client-cert but used in HTTPS proxy context. |
| 3409 | |
| 3410 | Providing --proxy-ssl-auto-client-cert multiple times has no extra effect. |
| 3411 | Disable it again with --no-proxy-ssl-auto-client-cert. |
| 3412 | |
| 3413 | Example: |
| 3414 | .nf |
| 3415 | curl --proxy-ssl-auto-client-cert -x https://proxy https://example.com |
| 3416 | .fi |
| 3417 | |
| 3418 | See also \fI--ssl-auto-client-cert\fP and \fI-x, --proxy\fP. Added in 7.77.0. |
| 3419 | .IP "\-\-proxy-tls13-ciphers <ciphersuite list>" |
| 3420 | (TLS) Specifies which cipher suites to use in the connection to your HTTPS proxy |
| 3421 | when it negotiates TLS 1.3. The list of ciphers suites must specify valid |
| 3422 | ciphers. Read up on TLS 1.3 cipher suite details on this URL: |
| 3423 | |
| 3424 | .nf |
| 3425 | https://curl.se/docs/ssl-ciphers.html |
| 3426 | .fi |
| 3427 | |
| 3428 | This option is currently used only when curl is built to use OpenSSL 1.1.1 or |
| 3429 | later. If you are using a different SSL backend you can try setting TLS 1.3 |
| 3430 | cipher suites by using the \-\-proxy-ciphers option. |
| 3431 | |
| 3432 | If --proxy-tls13-ciphers is provided several times, the last set value will be used. |
| 3433 | |
| 3434 | Example: |
| 3435 | .nf |
| 3436 | curl --proxy-tls13-ciphers TLS_AES_128_GCM_SHA256 -x proxy https://example.com |
| 3437 | .fi |
| 3438 | |
| 3439 | See also \fI--tls13-ciphers\fP and \fI--curves\fP. Added in 7.61.0. |
| 3440 | .IP "\-\-proxy-tlsauthtype <type>" |
| 3441 | Same as \-\-tlsauthtype but used in HTTPS proxy context. |
| 3442 | |
| 3443 | If --proxy-tlsauthtype is provided several times, the last set value will be used. |
| 3444 | |
| 3445 | Example: |
| 3446 | .nf |
| 3447 | curl --proxy-tlsauthtype SRP -x https://proxy https://example.com |
| 3448 | .fi |
| 3449 | |
| 3450 | See also \fI-x, --proxy\fP and \fI--proxy-tlsuser\fP. Added in 7.52.0. |
| 3451 | .IP "\-\-proxy-tlspassword <string>" |
| 3452 | Same as \-\-tlspassword but used in HTTPS proxy context. |
| 3453 | |
| 3454 | If --proxy-tlspassword is provided several times, the last set value will be used. |
| 3455 | |
| 3456 | Example: |
| 3457 | .nf |
| 3458 | curl --proxy-tlspassword passwd -x https://proxy https://example.com |
| 3459 | .fi |
| 3460 | |
| 3461 | See also \fI-x, --proxy\fP and \fI--proxy-tlsuser\fP. Added in 7.52.0. |
| 3462 | .IP "\-\-proxy-tlsuser <name>" |
| 3463 | Same as \-\-tlsuser but used in HTTPS proxy context. |
| 3464 | |
| 3465 | If --proxy-tlsuser is provided several times, the last set value will be used. |
| 3466 | |
| 3467 | Example: |
| 3468 | .nf |
| 3469 | curl --proxy-tlsuser smith -x https://proxy https://example.com |
| 3470 | .fi |
| 3471 | |
| 3472 | See also \fI-x, --proxy\fP and \fI--proxy-tlspassword\fP. Added in 7.52.0. |
| 3473 | .IP "\-\-proxy-tlsv1" |
| 3474 | Same as \-\-tlsv1 but used in HTTPS proxy context. |
| 3475 | |
| 3476 | Providing --proxy-tlsv1 multiple times has no extra effect. |
| 3477 | |
| 3478 | Example: |
| 3479 | .nf |
| 3480 | curl --proxy-tlsv1 -x https://proxy https://example.com |
| 3481 | .fi |
| 3482 | |
| 3483 | See also \fI-x, --proxy\fP. Added in 7.52.0. |
| 3484 | .IP "\-U, \-\-proxy-user <user:password>" |
| 3485 | Specify the user name and password to use for proxy authentication. |
| 3486 | |
| 3487 | If you use a Windows SSPI-enabled curl binary and do either Negotiate or NTLM |
| 3488 | authentication then you can tell curl to select the user name and password |
| 3489 | from your environment by specifying a single colon with this option: "-U :". |
| 3490 | |
| 3491 | On systems where it works, curl will hide the given option argument from |
| 3492 | process listings. This is not enough to protect credentials from possibly |
| 3493 | getting seen by other users on the same system as they will still be visible |
| 3494 | for a moment before cleared. Such sensitive data should be retrieved from a |
| 3495 | file instead or similar and never used in clear text in a command line. |
| 3496 | |
| 3497 | If --proxy-user is provided several times, the last set value will be used. |
| 3498 | |
| 3499 | Example: |
| 3500 | .nf |
| 3501 | curl --proxy-user name:pwd -x proxy https://example.com |
| 3502 | .fi |
| 3503 | |
| 3504 | See also \fI--proxy-pass\fP. |
| 3505 | .IP "\-x, \-\-proxy [protocol://]host[:port]" |
| 3506 | Use the specified proxy. |
| 3507 | |
| 3508 | The proxy string can be specified with a protocol:// prefix. No protocol |
| 3509 | specified or http:// will be treated as HTTP proxy. Use socks4://, socks4a://, |
| 3510 | socks5:// or socks5h:// to request a specific SOCKS version to be used. |
| 3511 | |
| 3512 | |
| 3513 | Unix domain sockets are supported for socks proxy. Set localhost for the host |
| 3514 | part. e.g. socks5h://localhost/path/to/socket.sock |
| 3515 | |
| 3516 | HTTPS proxy support via https:// protocol prefix was added in 7.52.0 for |
| 3517 | OpenSSL, GnuTLS and NSS. |
| 3518 | |
| 3519 | Unrecognized and unsupported proxy protocols cause an error since 7.52.0. |
| 3520 | Prior versions may ignore the protocol and use http:// instead. |
| 3521 | |
| 3522 | If the port number is not specified in the proxy string, it is assumed to be |
| 3523 | 1080. |
| 3524 | |
| 3525 | This option overrides existing environment variables that set the proxy to |
| 3526 | use. If there's an environment variable setting a proxy, you can set proxy to |
| 3527 | \(dq" to override it. |
| 3528 | |
| 3529 | All operations that are performed over an HTTP proxy will transparently be |
| 3530 | converted to HTTP. It means that certain protocol specific operations might |
| 3531 | not be available. This is not the case if you can tunnel through the proxy, as |
| 3532 | one with the \-\-proxytunnel option. |
| 3533 | |
| 3534 | User and password that might be provided in the proxy string are URL decoded |
| 3535 | by curl. This allows you to pass in special characters such as @ by using %40 |
| 3536 | or pass in a colon with %3a. |
| 3537 | |
| 3538 | The proxy host can be specified the same way as the proxy environment |
| 3539 | variables, including the protocol prefix (http://) and the embedded user + |
| 3540 | password. |
| 3541 | |
| 3542 | If --proxy is provided several times, the last set value will be used. |
| 3543 | |
| 3544 | Example: |
| 3545 | .nf |
| 3546 | curl --proxy http://proxy.example https://example.com |
| 3547 | .fi |
| 3548 | |
| 3549 | See also \fI--socks5\fP and \fI--proxy-basic\fP. |
| 3550 | .IP "\-\-proxy1.0 <host[:port]>" |
| 3551 | Use the specified HTTP 1.0 proxy. If the port number is not specified, it is |
| 3552 | assumed at port 1080. |
| 3553 | |
| 3554 | The only difference between this and the HTTP proxy option \fI\-x, \-\-proxy\fP, is that |
| 3555 | attempts to use CONNECT through the proxy will specify an HTTP 1.0 protocol |
| 3556 | instead of the default HTTP 1.1. |
| 3557 | |
| 3558 | Providing --proxy1.0 multiple times has no extra effect. |
| 3559 | |
| 3560 | Example: |
| 3561 | .nf |
| 3562 | curl --proxy1.0 -x http://proxy https://example.com |
| 3563 | .fi |
| 3564 | |
| 3565 | See also \fI-x, --proxy\fP, \fI--socks5\fP and \fI--preproxy\fP. |
| 3566 | .IP "\-p, \-\-proxytunnel" |
| 3567 | When an HTTP proxy is used \fI\-x, \-\-proxy\fP, this option will make curl tunnel through |
| 3568 | the proxy. The tunnel approach is made with the HTTP proxy CONNECT request and |
| 3569 | requires that the proxy allows direct connect to the remote port number curl |
| 3570 | wants to tunnel through to. |
| 3571 | |
| 3572 | To suppress proxy CONNECT response headers when curl is set to output headers |
| 3573 | use \fI\-\-suppress-connect-headers\fP. |
| 3574 | |
| 3575 | Providing --proxytunnel multiple times has no extra effect. |
| 3576 | Disable it again with --no-proxytunnel. |
| 3577 | |
| 3578 | Example: |
| 3579 | .nf |
| 3580 | curl --proxytunnel -x http://proxy https://example.com |
| 3581 | .fi |
| 3582 | |
| 3583 | See also \fI-x, --proxy\fP. |
| 3584 | .IP "\-\-pubkey <key>" |
| 3585 | (SFTP SCP) Public key file name. Allows you to provide your public key in this separate |
| 3586 | file. |
| 3587 | |
| 3588 | (As of 7.39.0, curl attempts to automatically extract the public key from the |
| 3589 | private key file, so passing this option is generally not required. Note that |
| 3590 | this public key extraction requires libcurl to be linked against a copy of |
| 3591 | libssh2 1.2.8 or higher that is itself linked against OpenSSL.) |
| 3592 | |
| 3593 | If --pubkey is provided several times, the last set value will be used. |
| 3594 | |
| 3595 | Example: |
| 3596 | .nf |
| 3597 | curl --pubkey file.pub sftp://example.com/ |
| 3598 | .fi |
| 3599 | |
| 3600 | See also \fI--pass\fP. |
| 3601 | .IP "\-Q, \-\-quote <command>" |
| 3602 | (FTP SFTP) Send an arbitrary command to the remote FTP or SFTP server. Quote commands are |
| 3603 | sent BEFORE the transfer takes place (just after the initial PWD command in an |
| 3604 | FTP transfer, to be exact). To make commands take place after a successful |
| 3605 | transfer, prefix them with a dash '-'. |
| 3606 | |
| 3607 | (FTP only) To make commands be sent after curl has changed the working |
| 3608 | directory, just before the file transfer command(s), prefix the command with a |
| 3609 | \(aq+'. This is not performed when a directory listing is performed. |
| 3610 | |
| 3611 | You may specify any number of commands. |
| 3612 | |
| 3613 | By default curl will stop at first failure. To make curl continue even if the |
| 3614 | command fails, prefix the command with an asterisk (*). Otherwise, if the |
| 3615 | server returns failure for one of the commands, the entire operation will be |
| 3616 | aborted. |
| 3617 | |
| 3618 | You must send syntactically correct FTP commands as RFC 959 defines to FTP |
| 3619 | servers, or one of the commands listed below to SFTP servers. |
| 3620 | |
| 3621 | This option can be used multiple times. |
| 3622 | |
| 3623 | SFTP is a binary protocol. Unlike for FTP, curl interprets SFTP quote commands |
| 3624 | itself before sending them to the server. File names may be quoted |
| 3625 | shell-style to embed spaces or special characters. Following is the list of |
| 3626 | all supported SFTP quote commands: |
| 3627 | .RS |
| 3628 | .IP "atime date file" |
| 3629 | The atime command sets the last access time of the file named by the file |
| 3630 | operand. The <date expression> can be all sorts of date strings, see the |
| 3631 | \fIcurl_getdate(3)\fP man page for date expression details. (Added in 7.73.0) |
| 3632 | .IP "chgrp group file" |
| 3633 | The chgrp command sets the group ID of the file named by the file operand to |
| 3634 | the group ID specified by the group operand. The group operand is a decimal |
| 3635 | integer group ID. |
| 3636 | .IP "chmod mode file" |
| 3637 | The chmod command modifies the file mode bits of the specified file. The |
| 3638 | mode operand is an octal integer mode number. |
| 3639 | .IP "chown user file" |
| 3640 | The chown command sets the owner of the file named by the file operand to the |
| 3641 | user ID specified by the user operand. The user operand is a decimal |
| 3642 | integer user ID. |
| 3643 | .IP "ln source_file target_file" |
| 3644 | The ln and symlink commands create a symbolic link at the target_file location |
| 3645 | pointing to the source_file location. |
| 3646 | .IP "mkdir directory_name" |
| 3647 | The mkdir command creates the directory named by the directory_name operand. |
| 3648 | .IP "mtime date file" |
| 3649 | The mtime command sets the last modification time of the file named by the |
| 3650 | file operand. The <date expression> can be all sorts of date strings, see the |
| 3651 | \fIcurl_getdate(3)\fP man page for date expression details. (Added in 7.73.0) |
| 3652 | .IP "pwd" |
| 3653 | The pwd command returns the absolute pathname of the current working directory. |
| 3654 | .IP "rename source target" |
| 3655 | The rename command renames the file or directory named by the source |
| 3656 | operand to the destination path named by the target operand. |
| 3657 | .IP "rm file" |
| 3658 | The rm command removes the file specified by the file operand. |
| 3659 | .IP "rmdir directory" |
| 3660 | The rmdir command removes the directory entry specified by the directory |
| 3661 | operand, provided it is empty. |
| 3662 | .IP "symlink source_file target_file" |
| 3663 | See ln. |
| 3664 | .RE |
| 3665 | |
| 3666 | --quote can be used several times in a command line |
| 3667 | |
| 3668 | Example: |
| 3669 | .nf |
| 3670 | curl --quote "DELE file" ftp://example.com/foo |
| 3671 | .fi |
| 3672 | |
| 3673 | See also \fI-X, --request\fP. |
| 3674 | .IP "\-\-random-file <file>" |
| 3675 | Deprecated option. This option is ignored by curl since 7.84.0. Prior to that |
| 3676 | it only had an effect on curl if built to use old versions of OpenSSL. |
| 3677 | |
| 3678 | Specify the path name to file containing what will be considered as random |
| 3679 | data. The data may be used to seed the random engine for SSL connections. |
| 3680 | |
| 3681 | If --random-file is provided several times, the last set value will be used. |
| 3682 | |
| 3683 | Example: |
| 3684 | .nf |
| 3685 | curl --random-file rubbish https://example.com |
| 3686 | .fi |
| 3687 | |
| 3688 | See also \fI--egd-file\fP. |
| 3689 | .IP "\-r, \-\-range <range>" |
| 3690 | (HTTP FTP SFTP FILE) Retrieve a byte range (i.e. a partial document) from an HTTP/1.1, FTP or SFTP |
| 3691 | server or a local FILE. Ranges can be specified in a number of ways. |
| 3692 | .RS |
| 3693 | .TP 10 |
| 3694 | .B 0-499 |
| 3695 | specifies the first 500 bytes |
| 3696 | .TP |
| 3697 | .B 500-999 |
| 3698 | specifies the second 500 bytes |
| 3699 | .TP |
| 3700 | .B \-500 |
| 3701 | specifies the last 500 bytes |
| 3702 | .TP |
| 3703 | .B 9500- |
| 3704 | specifies the bytes from offset 9500 and forward |
| 3705 | .TP |
| 3706 | .B 0-0,-1 |
| 3707 | specifies the first and last byte only(*)(HTTP) |
| 3708 | .TP |
| 3709 | .B 100-199,500-599 |
| 3710 | specifies two separate 100-byte ranges(*) (HTTP) |
| 3711 | .RE |
| 3712 | .IP |
| 3713 | (*) = NOTE that this will cause the server to reply with a multipart |
| 3714 | response, which will be returned as-is by curl! Parsing or otherwise |
| 3715 | transforming this response is the responsibility of the caller. |
| 3716 | |
| 3717 | Only digit characters (0-9) are valid in the 'start' and 'stop' fields of the |
| 3718 | \(aqstart-stop' range syntax. If a non-digit character is given in the range, |
| 3719 | the server's response will be unspecified, depending on the server's |
| 3720 | configuration. |
| 3721 | |
| 3722 | You should also be aware that many HTTP/1.1 servers do not have this feature |
| 3723 | enabled, so that when you attempt to get a range, you will instead get the |
| 3724 | whole document. |
| 3725 | |
| 3726 | FTP and SFTP range downloads only support the simple 'start-stop' syntax |
| 3727 | (optionally with one of the numbers omitted). FTP use depends on the extended |
| 3728 | FTP command SIZE. |
| 3729 | |
| 3730 | If --range is provided several times, the last set value will be used. |
| 3731 | |
| 3732 | Example: |
| 3733 | .nf |
| 3734 | curl --range 22-44 https://example.com |
| 3735 | .fi |
| 3736 | |
| 3737 | See also \fI-C, --continue-at\fP and \fI-a, --append\fP. |
| 3738 | .IP "\-\-rate <max request rate>" |
| 3739 | Specify the maximum transfer frequency you allow curl to use \- in number of |
| 3740 | transfer starts per time unit (sometimes called request rate). Without this |
| 3741 | option, curl will start the next transfer as fast as possible. |
| 3742 | |
| 3743 | If given several URLs and a transfer completes faster than the allowed rate, |
| 3744 | curl will wait until the next transfer is started to maintain the requested |
| 3745 | rate. This option has no effect when \-\-parallel is used. |
| 3746 | |
| 3747 | The request rate is provided as "N/U" where N is an integer number and U is a |
| 3748 | time unit. Supported units are 's' (second), 'm' (minute), 'h' (hour) and 'd' |
| 3749 | /(day, as in a 24 hour unit). The default time unit, if no "/U" is provided, |
| 3750 | is number of transfers per hour. |
| 3751 | |
| 3752 | If curl is told to allow 10 requests per minute, it will not start the next |
| 3753 | request until 6 seconds have elapsed since the previous transfer was started. |
| 3754 | |
| 3755 | This function uses millisecond resolution. If the allowed frequency is set |
| 3756 | more than 1000 per second, it will instead run unrestricted. |
| 3757 | |
| 3758 | When retrying transfers, enabled with \fI\-\-retry\fP, the separate retry delay logic |
| 3759 | is used and not this setting. |
| 3760 | |
| 3761 | If --rate is provided several times, the last set value will be used. |
| 3762 | |
| 3763 | Examples: |
| 3764 | .nf |
| 3765 | curl --rate 2/s https://example.com |
| 3766 | curl --rate 3/h https://example.com |
| 3767 | curl --rate 14/m https://example.com |
| 3768 | .fi |
| 3769 | |
| 3770 | See also \fI--limit-rate\fP and \fI--retry-delay\fP. Added in 7.84.0. |
| 3771 | .IP "\-\-raw" |
| 3772 | (HTTP) When used, it disables all internal HTTP decoding of content or transfer |
| 3773 | encodings and instead makes them passed on unaltered, raw. |
| 3774 | |
| 3775 | Providing --raw multiple times has no extra effect. |
| 3776 | Disable it again with --no-raw. |
| 3777 | |
| 3778 | Example: |
| 3779 | .nf |
| 3780 | curl --raw https://example.com |
| 3781 | .fi |
| 3782 | |
| 3783 | See also \fI--tr-encoding\fP. |
| 3784 | .IP "\-e, \-\-referer <URL>" |
| 3785 | (HTTP) Sends the "Referrer Page" information to the HTTP server. This can also be set |
| 3786 | with the \-\-header flag of course. When used with \-\-location you can append |
| 3787 | \(dq;auto" to the \-\-referer URL to make curl automatically set the previous URL |
| 3788 | when it follows a Location: header. The ";auto" string can be used alone, |
| 3789 | even if you do not set an initial \fI\-e, \-\-referer\fP. |
| 3790 | |
| 3791 | If --referer is provided several times, the last set value will be used. |
| 3792 | |
| 3793 | Examples: |
| 3794 | .nf |
| 3795 | curl --referer "https://fake.example" https://example.com |
| 3796 | curl --referer "https://fake.example;auto" -L https://example.com |
| 3797 | curl --referer ";auto" -L https://example.com |
| 3798 | .fi |
| 3799 | |
| 3800 | See also \fI-A, --user-agent\fP and \fI-H, --header\fP. |
| 3801 | .IP "\-J, \-\-remote-header-name" |
| 3802 | (HTTP) This option tells the \-\-remote-name option to use the server-specified |
| 3803 | Content-Disposition filename instead of extracting a filename from the URL. If |
| 3804 | the server-provided file name contains a path, that will be stripped off |
| 3805 | before the file name is used. |
| 3806 | |
| 3807 | The file is saved in the current directory, or in the directory specified with |
| 3808 | \fI\-\-output-dir\fP. |
| 3809 | |
| 3810 | If the server specifies a file name and a file with that name already exists |
| 3811 | in the destination directory, it will not be overwritten and an error will |
| 3812 | occur. If the server does not specify a file name then this option has no |
| 3813 | effect. |
| 3814 | |
| 3815 | There's no attempt to decode %-sequences (yet) in the provided file name, so |
| 3816 | this option may provide you with rather unexpected file names. |
| 3817 | |
| 3818 | \fBWARNING\fP: Exercise judicious use of this option, especially on Windows. A |
| 3819 | rogue server could send you the name of a DLL or other file that could be |
| 3820 | loaded automatically by Windows or some third party software. |
| 3821 | |
| 3822 | Providing --remote-header-name multiple times has no extra effect. |
| 3823 | Disable it again with --no-remote-header-name. |
| 3824 | |
| 3825 | Example: |
| 3826 | .nf |
| 3827 | curl -OJ https://example.com/file |
| 3828 | .fi |
| 3829 | |
| 3830 | See also \fI-O, --remote-name\fP. |
| 3831 | .IP "\-\-remote-name-all" |
| 3832 | This option changes the default action for all given URLs to be dealt with as |
| 3833 | if \-\-remote-name were used for each one. So if you want to disable that for a |
| 3834 | specific URL after \-\-remote-name-all has been used, you must use "-o \-" or |
| 3835 | \-\-no-remote-name. |
| 3836 | |
| 3837 | Providing --remote-name-all multiple times has no extra effect. |
| 3838 | Disable it again with --no-remote-name-all. |
| 3839 | |
| 3840 | Example: |
| 3841 | .nf |
| 3842 | curl --remote-name-all ftp://example.com/file1 ftp://example.com/file2 |
| 3843 | .fi |
| 3844 | |
| 3845 | See also \fI-O, --remote-name\fP. |
| 3846 | .IP "\-O, \-\-remote-name" |
| 3847 | Write output to a local file named like the remote file we get. (Only the file |
| 3848 | part of the remote file is used, the path is cut off.) |
| 3849 | |
| 3850 | The file will be saved in the current working directory. If you want the file |
| 3851 | saved in a different directory, make sure you change the current working |
| 3852 | directory before invoking curl with this option or use \fI\-\-output-dir\fP. |
| 3853 | |
| 3854 | The remote file name to use for saving is extracted from the given URL, |
| 3855 | nothing else, and if it already exists it will be overwritten. If you want the |
| 3856 | server to be able to choose the file name refer to \-\-remote-header-name which |
| 3857 | can be used in addition to this option. If the server chooses a file name and |
| 3858 | that name already exists it will not be overwritten. |
| 3859 | |
| 3860 | There is no URL decoding done on the file name. If it has %20 or other URL |
| 3861 | encoded parts of the name, they will end up as-is as file name. |
| 3862 | |
| 3863 | You may use this option as many times as the number of URLs you have. |
| 3864 | |
| 3865 | --remote-name can be used several times in a command line |
| 3866 | |
| 3867 | Example: |
| 3868 | .nf |
| 3869 | curl -O https://example.com/filename |
| 3870 | .fi |
| 3871 | |
| 3872 | See also \fI--remote-name-all\fP, \fI--output-dir\fP and \fI-J, --remote-header-name\fP. |
| 3873 | .IP "\-R, \-\-remote-time" |
| 3874 | When used, this will make curl attempt to figure out the timestamp of the |
| 3875 | remote file, and if that is available make the local file get that same |
| 3876 | timestamp. |
| 3877 | |
| 3878 | Providing --remote-time multiple times has no extra effect. |
| 3879 | Disable it again with --no-remote-time. |
| 3880 | |
| 3881 | Example: |
| 3882 | .nf |
| 3883 | curl --remote-time -o foo https://example.com |
| 3884 | .fi |
| 3885 | |
| 3886 | See also \fI-O, --remote-name\fP and \fI-z, --time-cond\fP. |
| 3887 | .IP "\-\-remove-on-error" |
| 3888 | When curl returns an error when told to save output in a local file, this |
| 3889 | option removes that saved file before exiting. This prevents curl from |
| 3890 | leaving a partial file in the case of an error during transfer. |
| 3891 | |
| 3892 | If the output is not a file, this option has no effect. |
| 3893 | |
| 3894 | Providing --remove-on-error multiple times has no extra effect. |
| 3895 | Disable it again with --no-remove-on-error. |
| 3896 | |
| 3897 | Example: |
| 3898 | .nf |
| 3899 | curl --remove-on-error -o output https://example.com |
| 3900 | .fi |
| 3901 | |
| 3902 | See also \fI-f, --fail\fP. Added in 7.83.0. |
| 3903 | .IP "\-\-request-target <path>" |
| 3904 | (HTTP) Tells curl to use an alternative "target" (path) instead of using the path as |
| 3905 | provided in the URL. Particularly useful when wanting to issue HTTP requests |
| 3906 | without leading slash or other data that does not follow the regular URL |
| 3907 | pattern, like "OPTIONS *". |
| 3908 | |
| 3909 | If --request-target is provided several times, the last set value will be used. |
| 3910 | |
| 3911 | Example: |
| 3912 | .nf |
| 3913 | curl --request-target "*" -X OPTIONS https://example.com |
| 3914 | .fi |
| 3915 | |
| 3916 | See also \fI-X, --request\fP. Added in 7.55.0. |
| 3917 | .IP "\-X, \-\-request <method>" |
| 3918 | (HTTP) Specifies a custom request method to use when communicating with the |
| 3919 | HTTP server. The specified request method will be used instead of the method |
| 3920 | otherwise used (which defaults to GET). Read the HTTP 1.1 specification for |
| 3921 | details and explanations. Common additional HTTP requests include PUT and |
| 3922 | DELETE, but related technologies like WebDAV offers PROPFIND, COPY, MOVE and |
| 3923 | more. |
| 3924 | |
| 3925 | Normally you do not need this option. All sorts of GET, HEAD, POST and PUT |
| 3926 | requests are rather invoked by using dedicated command line options. |
| 3927 | |
| 3928 | This option only changes the actual word used in the HTTP request, it does not |
| 3929 | alter the way curl behaves. So for example if you want to make a proper HEAD |
| 3930 | request, using \-X HEAD will not suffice. You need to use the \-\-head option. |
| 3931 | |
| 3932 | The method string you set with \-\-request will be used for all requests, which |
| 3933 | if you for example use \-\-location may cause unintended side-effects when curl |
| 3934 | does not change request method according to the HTTP 30x response codes \- and |
| 3935 | similar. |
| 3936 | |
| 3937 | (FTP) |
| 3938 | Specifies a custom FTP command to use instead of LIST when doing file lists |
| 3939 | with FTP. |
| 3940 | |
| 3941 | (POP3) |
| 3942 | Specifies a custom POP3 command to use instead of LIST or RETR. |
| 3943 | |
| 3944 | |
| 3945 | (IMAP) |
| 3946 | Specifies a custom IMAP command to use instead of LIST. (Added in 7.30.0) |
| 3947 | |
| 3948 | (SMTP) |
| 3949 | Specifies a custom SMTP command to use instead of HELP or VRFY. (Added in 7.34.0) |
| 3950 | |
| 3951 | If --request is provided several times, the last set value will be used. |
| 3952 | |
| 3953 | Examples: |
| 3954 | .nf |
| 3955 | curl -X "DELETE" https://example.com |
| 3956 | curl -X NLST ftp://example.com/ |
| 3957 | .fi |
| 3958 | |
| 3959 | See also \fI--request-target\fP. |
| 3960 | .IP "\-\-resolve <[+]host:port:addr[,addr]...>" |
| 3961 | Provide a custom address for a specific host and port pair. Using this, you |
| 3962 | can make the curl requests(s) use a specified address and prevent the |
| 3963 | otherwise normally resolved address to be used. Consider it a sort of |
| 3964 | /etc/hosts alternative provided on the command line. The port number should be |
| 3965 | the number used for the specific protocol the host will be used for. It means |
| 3966 | you need several entries if you want to provide address for the same host but |
| 3967 | different ports. |
| 3968 | |
| 3969 | By specifying '*' as host you can tell curl to resolve any host and specific |
| 3970 | port pair to the specified address. Wildcard is resolved last so any \-\-resolve |
| 3971 | with a specific host and port will be used first. |
| 3972 | |
| 3973 | The provided address set by this option will be used even if \-\-ipv4 or \-\-ipv6 |
| 3974 | is set to make curl use another IP version. |
| 3975 | |
| 3976 | By prefixing the host with a '+' you can make the entry time out after curl's |
| 3977 | default timeout (1 minute). Note that this will only make sense for long |
| 3978 | running parallel transfers with a lot of files. In such cases, if this option |
| 3979 | is used curl will try to resolve the host as it normally would once the |
| 3980 | timeout has expired. |
| 3981 | |
| 3982 | Support for providing the IP address within [brackets] was added in 7.57.0. |
| 3983 | |
| 3984 | Support for providing multiple IP addresses per entry was added in 7.59.0. |
| 3985 | |
| 3986 | Support for resolving with wildcard was added in 7.64.0. |
| 3987 | |
| 3988 | Support for the '+' prefix was was added in 7.75.0. |
| 3989 | |
| 3990 | This option can be used many times to add many host names to resolve. |
| 3991 | |
| 3992 | --resolve can be used several times in a command line |
| 3993 | |
| 3994 | Example: |
| 3995 | .nf |
| 3996 | curl --resolve example.com:443:127.0.0.1 https://example.com |
| 3997 | .fi |
| 3998 | |
| 3999 | See also \fI--connect-to\fP and \fI--alt-svc\fP. |
| 4000 | .IP "\-\-retry-all-errors" |
| 4001 | Retry on any error. This option is used together with \fI\-\-retry\fP. |
| 4002 | |
| 4003 | This option is the "sledgehammer" of retrying. Do not use this option by |
| 4004 | default (eg in curlrc), there may be unintended consequences such as sending or |
| 4005 | receiving duplicate data. Do not use with redirected input or output. You'd be |
| 4006 | much better off handling your unique problems in shell script. Please read the |
| 4007 | example below. |
| 4008 | |
| 4009 | \fBWARNING\fP: For server compatibility curl attempts to retry failed flaky |
| 4010 | transfers as close as possible to how they were started, but this is not |
| 4011 | possible with redirected input or output. For example, before retrying it |
| 4012 | removes output data from a failed partial transfer that was written to an |
| 4013 | output file. However this is not true of data redirected to a | pipe or > |
| 4014 | file, which are not reset. We strongly suggest you do not parse or record |
| 4015 | output via redirect in combination with this option, since you may receive |
| 4016 | duplicate data. |
| 4017 | |
| 4018 | By default curl will not error on an HTTP response code that indicates an HTTP |
| 4019 | error, if the transfer was successful. For example, if a server replies 404 |
| 4020 | Not Found and the reply is fully received then that is not an error. When |
| 4021 | \-\-retry is used then curl will retry on some HTTP response codes that indicate |
| 4022 | transient HTTP errors, but that does not include most 4xx response codes such |
| 4023 | as 404. If you want to retry on all response codes that indicate HTTP errors |
| 4024 | (4xx and 5xx) then combine with \fI\-f, \-\-fail\fP. |
| 4025 | |
| 4026 | Providing --retry-all-errors multiple times has no extra effect. |
| 4027 | Disable it again with --no-retry-all-errors. |
| 4028 | |
| 4029 | Example: |
| 4030 | .nf |
| 4031 | curl --retry 5 --retry-all-errors https://example.com |
| 4032 | .fi |
| 4033 | |
| 4034 | See also \fI--retry\fP. Added in 7.71.0. |
| 4035 | .IP "\-\-retry-connrefused" |
| 4036 | In addition to the other conditions, consider ECONNREFUSED as a transient |
| 4037 | error too for \fI\-\-retry\fP. This option is used together with \-\-retry. |
| 4038 | |
| 4039 | Providing --retry-connrefused multiple times has no extra effect. |
| 4040 | Disable it again with --no-retry-connrefused. |
| 4041 | |
| 4042 | Example: |
| 4043 | .nf |
| 4044 | curl --retry-connrefused --retry https://example.com |
| 4045 | .fi |
| 4046 | |
| 4047 | See also \fI--retry\fP and \fI--retry-all-errors\fP. Added in 7.52.0. |
| 4048 | .IP "\-\-retry-delay <seconds>" |
| 4049 | Make curl sleep this amount of time before each retry when a transfer has |
| 4050 | failed with a transient error (it changes the default backoff time algorithm |
| 4051 | between retries). This option is only interesting if \-\-retry is also |
| 4052 | used. Setting this delay to zero will make curl use the default backoff time. |
| 4053 | |
| 4054 | If --retry-delay is provided several times, the last set value will be used. |
| 4055 | |
| 4056 | Example: |
| 4057 | .nf |
| 4058 | curl --retry-delay 5 --retry https://example.com |
| 4059 | .fi |
| 4060 | |
| 4061 | See also \fI--retry\fP. |
| 4062 | .IP "\-\-retry-max-time <seconds>" |
| 4063 | The retry timer is reset before the first transfer attempt. Retries will be |
| 4064 | done as usual (see \fI\-\-retry\fP) as long as the timer has not reached this given |
| 4065 | limit. Notice that if the timer has not reached the limit, the request will be |
| 4066 | made and while performing, it may take longer than this given time period. To |
| 4067 | limit a single request's maximum time, use \fI\-m, \-\-max-time\fP. Set this option to |
| 4068 | zero to not timeout retries. |
| 4069 | |
| 4070 | If --retry-max-time is provided several times, the last set value will be used. |
| 4071 | |
| 4072 | Example: |
| 4073 | .nf |
| 4074 | curl --retry-max-time 30 --retry 10 https://example.com |
| 4075 | .fi |
| 4076 | |
| 4077 | See also \fI--retry\fP. |
| 4078 | .IP "\-\-retry <num>" |
| 4079 | If a transient error is returned when curl tries to perform a transfer, it |
| 4080 | will retry this number of times before giving up. Setting the number to 0 |
| 4081 | makes curl do no retries (which is the default). Transient error means either: |
| 4082 | a timeout, an FTP 4xx response code or an HTTP 408, 429, 500, 502, 503 or 504 |
| 4083 | response code. |
| 4084 | |
| 4085 | When curl is about to retry a transfer, it will first wait one second and then |
| 4086 | for all forthcoming retries it will double the waiting time until it reaches |
| 4087 | 10 minutes which then will be the delay between the rest of the retries. By |
| 4088 | using \-\-retry-delay you disable this exponential backoff algorithm. See also |
| 4089 | \-\-retry-max-time to limit the total time allowed for retries. |
| 4090 | |
| 4091 | Since curl 7.66.0, curl will comply with the Retry-After: response header if |
| 4092 | one was present to know when to issue the next retry. |
| 4093 | |
| 4094 | If --retry is provided several times, the last set value will be used. |
| 4095 | |
| 4096 | Example: |
| 4097 | .nf |
| 4098 | curl --retry 7 https://example.com |
| 4099 | .fi |
| 4100 | |
| 4101 | See also \fI--retry-max-time\fP. |
| 4102 | .IP "\-\-sasl-authzid <identity>" |
| 4103 | Use this authorization identity (authzid), during SASL PLAIN authentication, |
| 4104 | in addition to the authentication identity (authcid) as specified by \fI\-u, \-\-user\fP. |
| 4105 | |
| 4106 | If the option is not specified, the server will derive the authzid from the |
| 4107 | authcid, but if specified, and depending on the server implementation, it may |
| 4108 | be used to access another user's inbox, that the user has been granted access |
| 4109 | to, or a shared mailbox for example. |
| 4110 | |
| 4111 | If --sasl-authzid is provided several times, the last set value will be used. |
| 4112 | |
| 4113 | Example: |
| 4114 | .nf |
| 4115 | curl --sasl-authzid zid imap://example.com/ |
| 4116 | .fi |
| 4117 | |
| 4118 | See also \fI--login-options\fP. Added in 7.66.0. |
| 4119 | .IP "\-\-sasl-ir" |
| 4120 | Enable initial response in SASL authentication. |
| 4121 | |
| 4122 | Providing --sasl-ir multiple times has no extra effect. |
| 4123 | Disable it again with --no-sasl-ir. |
| 4124 | |
| 4125 | Example: |
| 4126 | .nf |
| 4127 | curl --sasl-ir imap://example.com/ |
| 4128 | .fi |
| 4129 | |
| 4130 | See also \fI--sasl-authzid\fP. Added in 7.31.0. |
| 4131 | .IP "\-\-service-name <name>" |
| 4132 | This option allows you to change the service name for SPNEGO. |
| 4133 | |
| 4134 | Examples: \fI\-\-negotiate\fP \-\-service-name sockd would use sockd/server-name. |
| 4135 | |
| 4136 | If --service-name is provided several times, the last set value will be used. |
| 4137 | |
| 4138 | Example: |
| 4139 | .nf |
| 4140 | curl --service-name sockd/server https://example.com |
| 4141 | .fi |
| 4142 | |
| 4143 | See also \fI--negotiate\fP and \fI--proxy-service-name\fP. Added in 7.43.0. |
| 4144 | .IP "\-S, \-\-show-error" |
| 4145 | When used with \fI\-s, \-\-silent\fP, it makes curl show an error message if it fails. |
| 4146 | |
| 4147 | This option is global and does not need to be specified for each use of |
| 4148 | \fI\-:, \-\-next\fP. |
| 4149 | |
| 4150 | Providing --show-error multiple times has no extra effect. |
| 4151 | Disable it again with --no-show-error. |
| 4152 | |
| 4153 | Example: |
| 4154 | .nf |
| 4155 | curl --show-error --silent https://example.com |
| 4156 | .fi |
| 4157 | |
| 4158 | See also \fI--no-progress-meter\fP. |
| 4159 | .IP "\-s, \-\-silent" |
| 4160 | Silent or quiet mode. Do not show progress meter or error messages. Makes Curl |
| 4161 | mute. It will still output the data you ask for, potentially even to the |
| 4162 | terminal/stdout unless you redirect it. |
| 4163 | |
| 4164 | Use \-\-show-error in addition to this option to disable progress meter but |
| 4165 | still show error messages. |
| 4166 | |
| 4167 | Providing --silent multiple times has no extra effect. |
| 4168 | Disable it again with --no-silent. |
| 4169 | |
| 4170 | Example: |
| 4171 | .nf |
| 4172 | curl -s https://example.com |
| 4173 | .fi |
| 4174 | |
| 4175 | See also \fI-v, --verbose\fP, \fI--stderr\fP and \fI--no-progress-meter\fP. |
| 4176 | .IP "\-\-socks4 <host[:port]>" |
| 4177 | Use the specified SOCKS4 proxy. If the port number is not specified, it is |
| 4178 | assumed at port 1080. Using this socket type make curl resolve the host name |
| 4179 | and passing the address on to the proxy. |
| 4180 | |
| 4181 | To specify proxy on a unix domain socket, use localhost for host, e.g. |
| 4182 | socks4://localhost/path/to/socket.sock |
| 4183 | |
| 4184 | This option overrides any previous use of \fI\-x, \-\-proxy\fP, as they are mutually |
| 4185 | exclusive. |
| 4186 | |
| 4187 | This option is superfluous since you can specify a socks4 proxy with \-\-proxy |
| 4188 | using a socks4:// protocol prefix. |
| 4189 | |
| 4190 | Since 7.52.0, \-\-preproxy can be used to specify a SOCKS proxy at the same time |
| 4191 | \-\-proxy is used with an HTTP/HTTPS proxy. In such a case curl first connects to |
| 4192 | the SOCKS proxy and then connects (through SOCKS) to the HTTP or HTTPS proxy. |
| 4193 | |
| 4194 | If --socks4 is provided several times, the last set value will be used. |
| 4195 | |
| 4196 | Example: |
| 4197 | .nf |
| 4198 | curl --socks4 hostname:4096 https://example.com |
| 4199 | .fi |
| 4200 | |
| 4201 | See also \fI--socks4a\fP, \fI--socks5\fP and \fI--socks5-hostname\fP. |
| 4202 | .IP "\-\-socks4a <host[:port]>" |
| 4203 | Use the specified SOCKS4a proxy. If the port number is not specified, it is |
| 4204 | assumed at port 1080. This asks the proxy to resolve the host name. |
| 4205 | |
| 4206 | To specify proxy on a unix domain socket, use localhost for host, e.g. |
| 4207 | socks4a://localhost/path/to/socket.sock |
| 4208 | |
| 4209 | This option overrides any previous use of \fI\-x, \-\-proxy\fP, as they are mutually |
| 4210 | exclusive. |
| 4211 | |
| 4212 | This option is superfluous since you can specify a socks4a proxy with \-\-proxy |
| 4213 | using a socks4a:// protocol prefix. |
| 4214 | |
| 4215 | Since 7.52.0, \-\-preproxy can be used to specify a SOCKS proxy at the same time |
| 4216 | \-\-proxy is used with an HTTP/HTTPS proxy. In such a case curl first connects to |
| 4217 | the SOCKS proxy and then connects (through SOCKS) to the HTTP or HTTPS proxy. |
| 4218 | |
| 4219 | If --socks4a is provided several times, the last set value will be used. |
| 4220 | |
| 4221 | Example: |
| 4222 | .nf |
| 4223 | curl --socks4a hostname:4096 https://example.com |
| 4224 | .fi |
| 4225 | |
| 4226 | See also \fI--socks4\fP, \fI--socks5\fP and \fI--socks5-hostname\fP. |
| 4227 | .IP "\-\-socks5-basic" |
| 4228 | Tells curl to use username/password authentication when connecting to a SOCKS5 |
| 4229 | proxy. The username/password authentication is enabled by default. Use |
| 4230 | \-\-socks5-gssapi to force GSS-API authentication to SOCKS5 proxies. |
| 4231 | |
| 4232 | Providing --socks5-basic multiple times has no extra effect. |
| 4233 | |
| 4234 | Example: |
| 4235 | .nf |
| 4236 | curl --socks5-basic --socks5 hostname:4096 https://example.com |
| 4237 | .fi |
| 4238 | |
| 4239 | See also \fI--socks5\fP. Added in 7.55.0. |
| 4240 | .IP "\-\-socks5-gssapi-nec" |
| 4241 | As part of the GSS-API negotiation a protection mode is negotiated. RFC 1961 |
| 4242 | says in section 4.3/4.4 it should be protected, but the NEC reference |
| 4243 | implementation does not. The option \-\-socks5-gssapi-nec allows the |
| 4244 | unprotected exchange of the protection mode negotiation. |
| 4245 | |
| 4246 | Providing --socks5-gssapi-nec multiple times has no extra effect. |
| 4247 | Disable it again with --no-socks5-gssapi-nec. |
| 4248 | |
| 4249 | Example: |
| 4250 | .nf |
| 4251 | curl --socks5-gssapi-nec --socks5 hostname:4096 https://example.com |
| 4252 | .fi |
| 4253 | |
| 4254 | See also \fI--socks5\fP. |
| 4255 | .IP "\-\-socks5-gssapi-service <name>" |
| 4256 | The default service name for a socks server is rcmd/server-fqdn. This option |
| 4257 | allows you to change it. |
| 4258 | |
| 4259 | Examples: \-\-socks5 proxy-name \-\-socks5-gssapi-service sockd would use |
| 4260 | sockd/proxy-name \-\-socks5 proxy-name \-\-socks5-gssapi-service sockd/real-name |
| 4261 | would use sockd/real-name for cases where the proxy-name does not match the |
| 4262 | principal name. |
| 4263 | |
| 4264 | If --socks5-gssapi-service is provided several times, the last set value will be used. |
| 4265 | |
| 4266 | Example: |
| 4267 | .nf |
| 4268 | curl --socks5-gssapi-service sockd --socks5 hostname:4096 https://example.com |
| 4269 | .fi |
| 4270 | |
| 4271 | See also \fI--socks5\fP. |
| 4272 | .IP "\-\-socks5-gssapi" |
| 4273 | Tells curl to use GSS-API authentication when connecting to a SOCKS5 proxy. |
| 4274 | The GSS-API authentication is enabled by default (if curl is compiled with |
| 4275 | GSS-API support). Use \-\-socks5-basic to force username/password authentication |
| 4276 | to SOCKS5 proxies. |
| 4277 | |
| 4278 | Providing --socks5-gssapi multiple times has no extra effect. |
| 4279 | Disable it again with --no-socks5-gssapi. |
| 4280 | |
| 4281 | Example: |
| 4282 | .nf |
| 4283 | curl --socks5-gssapi --socks5 hostname:4096 https://example.com |
| 4284 | .fi |
| 4285 | |
| 4286 | See also \fI--socks5\fP. Added in 7.55.0. |
| 4287 | .IP "\-\-socks5-hostname <host[:port]>" |
| 4288 | Use the specified SOCKS5 proxy (and let the proxy resolve the host name). If |
| 4289 | the port number is not specified, it is assumed at port 1080. |
| 4290 | |
| 4291 | To specify proxy on a unix domain socket, use localhost for host, e.g. |
| 4292 | socks5h://localhost/path/to/socket.sock |
| 4293 | |
| 4294 | This option overrides any previous use of \fI\-x, \-\-proxy\fP, as they are mutually |
| 4295 | exclusive. |
| 4296 | |
| 4297 | This option is superfluous since you can specify a socks5 hostname proxy with |
| 4298 | \-\-proxy using a socks5h:// protocol prefix. |
| 4299 | |
| 4300 | Since 7.52.0, \-\-preproxy can be used to specify a SOCKS proxy at the same time |
| 4301 | \-\-proxy is used with an HTTP/HTTPS proxy. In such a case curl first connects to |
| 4302 | the SOCKS proxy and then connects (through SOCKS) to the HTTP or HTTPS proxy. |
| 4303 | |
| 4304 | If --socks5-hostname is provided several times, the last set value will be used. |
| 4305 | |
| 4306 | Example: |
| 4307 | .nf |
| 4308 | curl --socks5-hostname proxy.example:7000 https://example.com |
| 4309 | .fi |
| 4310 | |
| 4311 | See also \fI--socks5\fP and \fI--socks4a\fP. |
| 4312 | .IP "\-\-socks5 <host[:port]>" |
| 4313 | Use the specified SOCKS5 proxy \- but resolve the host name locally. If the |
| 4314 | port number is not specified, it is assumed at port 1080. |
| 4315 | |
| 4316 | To specify proxy on a unix domain socket, use localhost for host, e.g. |
| 4317 | socks5://localhost/path/to/socket.sock |
| 4318 | |
| 4319 | This option overrides any previous use of \fI\-x, \-\-proxy\fP, as they are mutually |
| 4320 | exclusive. |
| 4321 | |
| 4322 | This option is superfluous since you can specify a socks5 proxy with \-\-proxy |
| 4323 | using a socks5:// protocol prefix. |
| 4324 | |
| 4325 | Since 7.52.0, \-\-preproxy can be used to specify a SOCKS proxy at the same time |
| 4326 | \-\-proxy is used with an HTTP/HTTPS proxy. In such a case curl first connects to |
| 4327 | the SOCKS proxy and then connects (through SOCKS) to the HTTP or HTTPS proxy. |
| 4328 | |
| 4329 | This option (as well as \fI\-\-socks4\fP) does not work with IPV6, FTPS or LDAP. |
| 4330 | |
| 4331 | If --socks5 is provided several times, the last set value will be used. |
| 4332 | |
| 4333 | Example: |
| 4334 | .nf |
| 4335 | curl --socks5 proxy.example:7000 https://example.com |
| 4336 | .fi |
| 4337 | |
| 4338 | See also \fI--socks5-hostname\fP and \fI--socks4a\fP. |
| 4339 | .IP "\-Y, \-\-speed-limit <speed>" |
| 4340 | If a transfer is slower than this given speed (in bytes per second) for |
| 4341 | speed-time seconds it gets aborted. speed-time is set with \-\-speed-time and is |
| 4342 | 30 if not set. |
| 4343 | |
| 4344 | If --speed-limit is provided several times, the last set value will be used. |
| 4345 | |
| 4346 | Example: |
| 4347 | .nf |
| 4348 | curl --speed-limit 300 --speed-time 10 https://example.com |
| 4349 | .fi |
| 4350 | |
| 4351 | See also \fI-y, --speed-time\fP, \fI--limit-rate\fP and \fI-m, --max-time\fP. |
| 4352 | .IP "\-y, \-\-speed-time <seconds>" |
| 4353 | If a transfer runs slower than speed-limit bytes per second during a speed-time |
| 4354 | period, the transfer is aborted. If speed-time is used, the default |
| 4355 | speed-limit will be 1 unless set with \fI\-Y, \-\-speed-limit\fP. |
| 4356 | |
| 4357 | This option controls transfers (in both directions) but will not affect slow |
| 4358 | connects etc. If this is a concern for you, try the \-\-connect-timeout option. |
| 4359 | |
| 4360 | If --speed-time is provided several times, the last set value will be used. |
| 4361 | |
| 4362 | Example: |
| 4363 | .nf |
| 4364 | curl --speed-limit 300 --speed-time 10 https://example.com |
| 4365 | .fi |
| 4366 | |
| 4367 | See also \fI-Y, --speed-limit\fP and \fI--limit-rate\fP. |
| 4368 | .IP "\-\-ssl-allow-beast" |
| 4369 | This option tells curl to not work around a security flaw in the SSL3 and |
| 4370 | TLS1.0 protocols known as BEAST. If this option is not used, the SSL layer |
| 4371 | may use workarounds known to cause interoperability problems with some older |
| 4372 | SSL implementations. |
| 4373 | |
| 4374 | \fBWARNING\fP: this option loosens the SSL security, and by using this flag you |
| 4375 | ask for exactly that. |
| 4376 | |
| 4377 | Providing --ssl-allow-beast multiple times has no extra effect. |
| 4378 | Disable it again with --no-ssl-allow-beast. |
| 4379 | |
| 4380 | Example: |
| 4381 | .nf |
| 4382 | curl --ssl-allow-beast https://example.com |
| 4383 | .fi |
| 4384 | |
| 4385 | See also \fI--proxy-ssl-allow-beast\fP and \fI-k, --insecure\fP. |
| 4386 | .IP "\-\-ssl-auto-client-cert" |
| 4387 | Tell libcurl to automatically locate and use a client certificate for |
| 4388 | authentication, when requested by the server. This option is only supported |
| 4389 | for Schannel (the native Windows SSL library). Prior to 7.77.0 this was the |
| 4390 | default behavior in libcurl with Schannel. Since the server can request any |
| 4391 | certificate that supports client authentication in the OS certificate store it |
| 4392 | could be a privacy violation and unexpected. |
| 4393 | |
| 4394 | Providing --ssl-auto-client-cert multiple times has no extra effect. |
| 4395 | Disable it again with --no-ssl-auto-client-cert. |
| 4396 | |
| 4397 | Example: |
| 4398 | .nf |
| 4399 | curl --ssl-auto-client-cert https://example.com |
| 4400 | .fi |
| 4401 | |
| 4402 | See also \fI--proxy-ssl-auto-client-cert\fP. Added in 7.77.0. |
| 4403 | .IP "\-\-ssl-no-revoke" |
| 4404 | (Schannel) This option tells curl to disable certificate revocation checks. |
| 4405 | WARNING: this option loosens the SSL security, and by using this flag you ask |
| 4406 | for exactly that. |
| 4407 | |
| 4408 | Providing --ssl-no-revoke multiple times has no extra effect. |
| 4409 | Disable it again with --no-ssl-no-revoke. |
| 4410 | |
| 4411 | Example: |
| 4412 | .nf |
| 4413 | curl --ssl-no-revoke https://example.com |
| 4414 | .fi |
| 4415 | |
| 4416 | See also \fI--crlfile\fP. Added in 7.44.0. |
| 4417 | .IP "\-\-ssl-reqd" |
| 4418 | (FTP IMAP POP3 SMTP LDAP) Require SSL/TLS for the connection. Terminates the connection if the server |
| 4419 | does not support SSL/TLS. |
| 4420 | |
| 4421 | This option is handled in LDAP since version 7.81.0. It is fully supported |
| 4422 | by the OpenLDAP backend and rejected by the generic ldap backend if explicit |
| 4423 | TLS is required. |
| 4424 | |
| 4425 | This option was formerly known as \-\-ftp-ssl-reqd. |
| 4426 | |
| 4427 | Providing --ssl-reqd multiple times has no extra effect. |
| 4428 | Disable it again with --no-ssl-reqd. |
| 4429 | |
| 4430 | Example: |
| 4431 | .nf |
| 4432 | curl --ssl-reqd ftp://example.com |
| 4433 | .fi |
| 4434 | |
| 4435 | See also \fI--ssl\fP and \fI-k, --insecure\fP. |
| 4436 | .IP "\-\-ssl-revoke-best-effort" |
| 4437 | (Schannel) This option tells curl to ignore certificate revocation checks when |
| 4438 | they failed due to missing/offline distribution points for the revocation check |
| 4439 | lists. |
| 4440 | |
| 4441 | Providing --ssl-revoke-best-effort multiple times has no extra effect. |
| 4442 | Disable it again with --no-ssl-revoke-best-effort. |
| 4443 | |
| 4444 | Example: |
| 4445 | .nf |
| 4446 | curl --ssl-revoke-best-effort https://example.com |
| 4447 | .fi |
| 4448 | |
| 4449 | See also \fI--crlfile\fP and \fI-k, --insecure\fP. Added in 7.70.0. |
| 4450 | .IP "\-\-ssl" |
| 4451 | (FTP IMAP POP3 SMTP LDAP) Warning: this is considered an insecure option. Consider using \-\-ssl-reqd |
| 4452 | instead to be sure curl upgrades to a secure connection. |
| 4453 | |
| 4454 | Try to use SSL/TLS for the connection. Reverts to a non-secure connection if |
| 4455 | the server does not support SSL/TLS. See also \-\-ftp-ssl-control and \-\-ssl-reqd |
| 4456 | for different levels of encryption required. |
| 4457 | |
| 4458 | This option is handled in LDAP since version 7.81.0. It is fully supported |
| 4459 | by the OpenLDAP backend and ignored by the generic ldap backend. |
| 4460 | |
| 4461 | Please note that a server may close the connection if the negotiation does |
| 4462 | not succeed. |
| 4463 | |
| 4464 | This option was formerly known as \-\-ftp-ssl. That option |
| 4465 | name can still be used but will be removed in a future version. |
| 4466 | |
| 4467 | Providing --ssl multiple times has no extra effect. |
| 4468 | Disable it again with --no-ssl. |
| 4469 | |
| 4470 | Example: |
| 4471 | .nf |
| 4472 | curl --ssl pop3://example.com/ |
| 4473 | .fi |
| 4474 | |
| 4475 | See also \fI--ssl-reqd\fP, \fI-k, --insecure\fP and \fI--ciphers\fP. |
| 4476 | .IP "\-2, \-\-sslv2" |
| 4477 | (SSL) This option previously asked curl to use SSLv2, but starting in curl 7.77.0 |
| 4478 | this instruction is ignored. SSLv2 is widely considered insecure (see RFC |
| 4479 | 6176). |
| 4480 | |
| 4481 | Providing --sslv2 multiple times has no extra effect. |
| 4482 | |
| 4483 | Example: |
| 4484 | .nf |
| 4485 | curl --sslv2 https://example.com |
| 4486 | .fi |
| 4487 | |
| 4488 | See also \fI--http1.1\fP and \fI--http2\fP. \fI-2, --sslv2\fP requires that the underlying libcurl was built to support TLS. This option is mutually exclusive to \fI-3, --sslv3\fP and \fI-1, --tlsv1\fP and \fI--tlsv1.1\fP and \fI--tlsv1.2\fP. |
| 4489 | .IP "\-3, \-\-sslv3" |
| 4490 | (SSL) This option previously asked curl to use SSLv3, but starting in curl 7.77.0 |
| 4491 | this instruction is ignored. SSLv3 is widely considered insecure (see RFC |
| 4492 | 7568). |
| 4493 | |
| 4494 | Providing --sslv3 multiple times has no extra effect. |
| 4495 | |
| 4496 | Example: |
| 4497 | .nf |
| 4498 | curl --sslv3 https://example.com |
| 4499 | .fi |
| 4500 | |
| 4501 | See also \fI--http1.1\fP and \fI--http2\fP. \fI-3, --sslv3\fP requires that the underlying libcurl was built to support TLS. This option is mutually exclusive to \fI-2, --sslv2\fP and \fI-1, --tlsv1\fP and \fI--tlsv1.1\fP and \fI--tlsv1.2\fP. |
| 4502 | .IP "\-\-stderr <file>" |
| 4503 | Redirect all writes to stderr to the specified file instead. If the file name |
| 4504 | is a plain '-', it is instead written to stdout. |
| 4505 | |
| 4506 | This option is global and does not need to be specified for each use of |
| 4507 | \fI\-:, \-\-next\fP. |
| 4508 | |
| 4509 | If --stderr is provided several times, the last set value will be used. |
| 4510 | |
| 4511 | Example: |
| 4512 | .nf |
| 4513 | curl --stderr output.txt https://example.com |
| 4514 | .fi |
| 4515 | |
| 4516 | See also \fI-v, --verbose\fP and \fI-s, --silent\fP. |
| 4517 | .IP "\-\-styled-output" |
| 4518 | Enables the automatic use of bold font styles when writing HTTP headers to the |
| 4519 | terminal. Use \-\-no-styled-output to switch them off. |
| 4520 | |
| 4521 | This option is global and does not need to be specified for each use of |
| 4522 | \fI\-:, \-\-next\fP. |
| 4523 | |
| 4524 | Providing --styled-output multiple times has no extra effect. |
| 4525 | Disable it again with --no-styled-output. |
| 4526 | |
| 4527 | Example: |
| 4528 | .nf |
| 4529 | curl --styled-output -I https://example.com |
| 4530 | .fi |
| 4531 | |
| 4532 | See also \fI-I, --head\fP and \fI-v, --verbose\fP. Added in 7.61.0. |
| 4533 | .IP "\-\-suppress-connect-headers" |
| 4534 | When \-\-proxytunnel is used and a CONNECT request is made do not output proxy |
| 4535 | CONNECT response headers. This option is meant to be used with \-\-dump-header or |
| 4536 | \-\-include which are used to show protocol headers in the output. It has no |
| 4537 | effect on debug options such as \-\-verbose or \fI\-\-trace\fP, or any statistics. |
| 4538 | |
| 4539 | Providing --suppress-connect-headers multiple times has no extra effect. |
| 4540 | Disable it again with --no-suppress-connect-headers. |
| 4541 | |
| 4542 | Example: |
| 4543 | .nf |
| 4544 | curl --suppress-connect-headers --include -x proxy https://example.com |
| 4545 | .fi |
| 4546 | |
| 4547 | See also \fI-D, --dump-header\fP, \fI-i, --include\fP and \fI-p, --proxytunnel\fP. Added in 7.54.0. |
| 4548 | .IP "\-\-tcp-fastopen" |
| 4549 | Enable use of TCP Fast Open (RFC7413). |
| 4550 | |
| 4551 | Providing --tcp-fastopen multiple times has no extra effect. |
| 4552 | Disable it again with --no-tcp-fastopen. |
| 4553 | |
| 4554 | Example: |
| 4555 | .nf |
| 4556 | curl --tcp-fastopen https://example.com |
| 4557 | .fi |
| 4558 | |
| 4559 | See also \fI--false-start\fP. Added in 7.49.0. |
| 4560 | .IP "\-\-tcp-nodelay" |
| 4561 | Turn on the TCP_NODELAY option. See the \fIcurl_easy_setopt(3)\fP man page for |
| 4562 | details about this option. |
| 4563 | |
| 4564 | Since 7.50.2, curl sets this option by default and you need to explicitly |
| 4565 | switch it off if you do not want it on. |
| 4566 | |
| 4567 | Providing --tcp-nodelay multiple times has no extra effect. |
| 4568 | Disable it again with --no-tcp-nodelay. |
| 4569 | |
| 4570 | Example: |
| 4571 | .nf |
| 4572 | curl --tcp-nodelay https://example.com |
| 4573 | .fi |
| 4574 | |
| 4575 | See also \fI-N, --no-buffer\fP. |
| 4576 | .IP "\-t, \-\-telnet-option <opt=val>" |
| 4577 | Pass options to the telnet protocol. Supported options are: |
| 4578 | |
| 4579 | TTYPE=<term> Sets the terminal type. |
| 4580 | |
| 4581 | XDISPLOC=<X display> Sets the X display location. |
| 4582 | |
| 4583 | NEW_ENV=<var,val> Sets an environment variable. |
| 4584 | |
| 4585 | --telnet-option can be used several times in a command line |
| 4586 | |
| 4587 | Example: |
| 4588 | .nf |
| 4589 | curl -t TTYPE=vt100 telnet://example.com/ |
| 4590 | .fi |
| 4591 | |
| 4592 | See also \fI-K, --config\fP. |
| 4593 | .IP "\-\-tftp-blksize <value>" |
| 4594 | (TFTP) Set TFTP BLKSIZE option (must be >512). This is the block size that curl will |
| 4595 | try to use when transferring data to or from a TFTP server. By default 512 |
| 4596 | bytes will be used. |
| 4597 | |
| 4598 | If --tftp-blksize is provided several times, the last set value will be used. |
| 4599 | |
| 4600 | Example: |
| 4601 | .nf |
| 4602 | curl --tftp-blksize 1024 tftp://example.com/file |
| 4603 | .fi |
| 4604 | |
| 4605 | See also \fI--tftp-no-options\fP. |
| 4606 | .IP "\-\-tftp-no-options" |
| 4607 | (TFTP) Tells curl not to send TFTP options requests. |
| 4608 | |
| 4609 | This option improves interop with some legacy servers that do not acknowledge |
| 4610 | or properly implement TFTP options. When this option is used \-\-tftp-blksize is |
| 4611 | ignored. |
| 4612 | |
| 4613 | Providing --tftp-no-options multiple times has no extra effect. |
| 4614 | Disable it again with --no-tftp-no-options. |
| 4615 | |
| 4616 | Example: |
| 4617 | .nf |
| 4618 | curl --tftp-no-options tftp://192.168.0.1/ |
| 4619 | .fi |
| 4620 | |
| 4621 | See also \fI--tftp-blksize\fP. Added in 7.48.0. |
| 4622 | .IP "\-z, \-\-time-cond <time>" |
| 4623 | (HTTP FTP) Request a file that has been modified later than the given time and date, or |
| 4624 | one that has been modified before that time. The <date expression> can be all |
| 4625 | sorts of date strings or if it does not match any internal ones, it is taken as |
| 4626 | a filename and tries to get the modification date (mtime) from <file> |
| 4627 | instead. See the \fIcurl_getdate(3)\fP man pages for date expression details. |
| 4628 | |
| 4629 | Start the date expression with a dash (-) to make it request for a document |
| 4630 | that is older than the given date/time, default is a document that is newer |
| 4631 | than the specified date/time. |
| 4632 | |
| 4633 | If --time-cond is provided several times, the last set value will be used. |
| 4634 | |
| 4635 | Examples: |
| 4636 | .nf |
| 4637 | curl -z "Wed 01 Sep 2021 12:18:00" https://example.com |
| 4638 | curl -z "-Wed 01 Sep 2021 12:18:00" https://example.com |
| 4639 | curl -z file https://example.com |
| 4640 | .fi |
| 4641 | |
| 4642 | See also \fI--etag-compare\fP and \fI-R, --remote-time\fP. |
| 4643 | .IP "\-\-tls-max <VERSION>" |
| 4644 | (SSL) VERSION defines maximum supported TLS version. The minimum acceptable version |
| 4645 | is set by tlsv1.0, tlsv1.1, tlsv1.2 or tlsv1.3. |
| 4646 | |
| 4647 | If the connection is done without TLS, this option has no effect. This |
| 4648 | includes QUIC-using (HTTP/3) transfers. |
| 4649 | |
| 4650 | .RS |
| 4651 | .IP "default" |
| 4652 | Use up to recommended TLS version. |
| 4653 | .IP "1.0" |
| 4654 | Use up to TLSv1.0. |
| 4655 | .IP "1.1" |
| 4656 | Use up to TLSv1.1. |
| 4657 | .IP "1.2" |
| 4658 | Use up to TLSv1.2. |
| 4659 | .IP "1.3" |
| 4660 | Use up to TLSv1.3. |
| 4661 | .RE |
| 4662 | |
| 4663 | If --tls-max is provided several times, the last set value will be used. |
| 4664 | |
| 4665 | Examples: |
| 4666 | .nf |
| 4667 | curl --tls-max 1.2 https://example.com |
| 4668 | curl --tls-max 1.3 --tlsv1.2 https://example.com |
| 4669 | .fi |
| 4670 | |
| 4671 | See also \fI--tlsv1.0\fP, \fI--tlsv1.1\fP, \fI--tlsv1.2\fP and \fI--tlsv1.3\fP. \fI--tls-max\fP requires that the underlying libcurl was built to support TLS. Added in 7.54.0. |
| 4672 | .IP "\-\-tls13-ciphers <ciphersuite list>" |
| 4673 | (TLS) Specifies which cipher suites to use in the connection if it negotiates TLS |
| 4674 | 1.3. The list of ciphers suites must specify valid ciphers. Read up on TLS 1.3 |
| 4675 | cipher suite details on this URL: |
| 4676 | |
| 4677 | .nf |
| 4678 | https://curl.se/docs/ssl-ciphers.html |
| 4679 | .fi |
| 4680 | |
| 4681 | This option is currently used only when curl is built to use OpenSSL 1.1.1 or |
| 4682 | later. If you are using a different SSL backend you can try setting TLS 1.3 |
| 4683 | cipher suites by using the \-\-ciphers option. |
| 4684 | |
| 4685 | If --tls13-ciphers is provided several times, the last set value will be used. |
| 4686 | |
| 4687 | Example: |
| 4688 | .nf |
| 4689 | curl --tls13-ciphers TLS_AES_128_GCM_SHA256 https://example.com |
| 4690 | .fi |
| 4691 | |
| 4692 | See also \fI--ciphers\fP and \fI--curves\fP. Added in 7.61.0. |
| 4693 | .IP "\-\-tlsauthtype <type>" |
| 4694 | Set TLS authentication type. Currently, the only supported option is "SRP", |
| 4695 | for TLS-SRP (RFC 5054). If \-\-tlsuser and \-\-tlspassword are specified but |
| 4696 | \-\-tlsauthtype is not, then this option defaults to "SRP". This option works |
| 4697 | only if the underlying libcurl is built with TLS-SRP support, which requires |
| 4698 | OpenSSL or GnuTLS with TLS-SRP support. |
| 4699 | |
| 4700 | If --tlsauthtype is provided several times, the last set value will be used. |
| 4701 | |
| 4702 | Example: |
| 4703 | .nf |
| 4704 | curl --tlsauthtype SRP https://example.com |
| 4705 | .fi |
| 4706 | |
| 4707 | See also \fI--tlsuser\fP. |
| 4708 | .IP "\-\-tlspassword <string>" |
| 4709 | Set password for use with the TLS authentication method specified with |
| 4710 | \fI\-\-tlsauthtype\fP. Requires that \-\-tlsuser also be set. |
| 4711 | |
| 4712 | This option does not work with TLS 1.3. |
| 4713 | |
| 4714 | If --tlspassword is provided several times, the last set value will be used. |
| 4715 | |
| 4716 | Example: |
| 4717 | .nf |
| 4718 | curl --tlspassword pwd --tlsuser user https://example.com |
| 4719 | .fi |
| 4720 | |
| 4721 | See also \fI--tlsuser\fP. |
| 4722 | .IP "\-\-tlsuser <name>" |
| 4723 | Set username for use with the TLS authentication method specified with |
| 4724 | \fI\-\-tlsauthtype\fP. Requires that \-\-tlspassword also is set. |
| 4725 | |
| 4726 | This option does not work with TLS 1.3. |
| 4727 | |
| 4728 | If --tlsuser is provided several times, the last set value will be used. |
| 4729 | |
| 4730 | Example: |
| 4731 | .nf |
| 4732 | curl --tlspassword pwd --tlsuser user https://example.com |
| 4733 | .fi |
| 4734 | |
| 4735 | See also \fI--tlspassword\fP. |
| 4736 | .IP "\-\-tlsv1.0" |
| 4737 | (TLS) Forces curl to use TLS version 1.0 or later when connecting to a remote TLS server. |
| 4738 | |
| 4739 | In old versions of curl this option was documented to allow _only_ TLS 1.0. |
| 4740 | That behavior was inconsistent depending on the TLS library. Use \-\-tls-max if |
| 4741 | you want to set a maximum TLS version. |
| 4742 | |
| 4743 | Providing --tlsv1.0 multiple times has no extra effect. |
| 4744 | |
| 4745 | Example: |
| 4746 | .nf |
| 4747 | curl --tlsv1.0 https://example.com |
| 4748 | .fi |
| 4749 | |
| 4750 | See also \fI--tlsv1.3\fP. Added in 7.34.0. |
| 4751 | .IP "\-\-tlsv1.1" |
| 4752 | (TLS) Forces curl to use TLS version 1.1 or later when connecting to a remote TLS server. |
| 4753 | |
| 4754 | In old versions of curl this option was documented to allow _only_ TLS 1.1. |
| 4755 | That behavior was inconsistent depending on the TLS library. Use \-\-tls-max if |
| 4756 | you want to set a maximum TLS version. |
| 4757 | |
| 4758 | Providing --tlsv1.1 multiple times has no extra effect. |
| 4759 | |
| 4760 | Example: |
| 4761 | .nf |
| 4762 | curl --tlsv1.1 https://example.com |
| 4763 | .fi |
| 4764 | |
| 4765 | See also \fI--tlsv1.3\fP and \fI--tls-max\fP. Added in 7.34.0. |
| 4766 | .IP "\-\-tlsv1.2" |
| 4767 | (TLS) Forces curl to use TLS version 1.2 or later when connecting to a remote TLS server. |
| 4768 | |
| 4769 | In old versions of curl this option was documented to allow _only_ TLS 1.2. |
| 4770 | That behavior was inconsistent depending on the TLS library. Use \-\-tls-max if |
| 4771 | you want to set a maximum TLS version. |
| 4772 | |
| 4773 | Providing --tlsv1.2 multiple times has no extra effect. |
| 4774 | |
| 4775 | Example: |
| 4776 | .nf |
| 4777 | curl --tlsv1.2 https://example.com |
| 4778 | .fi |
| 4779 | |
| 4780 | See also \fI--tlsv1.3\fP and \fI--tls-max\fP. Added in 7.34.0. |
| 4781 | .IP "\-\-tlsv1.3" |
| 4782 | (TLS) Forces curl to use TLS version 1.3 or later when connecting to a remote TLS |
| 4783 | server. |
| 4784 | |
| 4785 | If the connection is done without TLS, this option has no effect. This |
| 4786 | includes QUIC-using (HTTP/3) transfers. |
| 4787 | |
| 4788 | Note that TLS 1.3 is not supported by all TLS backends. |
| 4789 | |
| 4790 | Providing --tlsv1.3 multiple times has no extra effect. |
| 4791 | |
| 4792 | Example: |
| 4793 | .nf |
| 4794 | curl --tlsv1.3 https://example.com |
| 4795 | .fi |
| 4796 | |
| 4797 | See also \fI--tlsv1.2\fP and \fI--tls-max\fP. Added in 7.52.0. |
| 4798 | .IP "\-1, \-\-tlsv1" |
| 4799 | (SSL) Tells curl to use at least TLS version 1.x when negotiating with a remote TLS |
| 4800 | server. That means TLS version 1.0 or higher |
| 4801 | |
| 4802 | Providing --tlsv1 multiple times has no extra effect. |
| 4803 | |
| 4804 | Example: |
| 4805 | .nf |
| 4806 | curl --tlsv1 https://example.com |
| 4807 | .fi |
| 4808 | |
| 4809 | See also \fI--http1.1\fP and \fI--http2\fP. \fI-1, --tlsv1\fP requires that the underlying libcurl was built to support TLS. This option is mutually exclusive to \fI--tlsv1.1\fP and \fI--tlsv1.2\fP and \fI--tlsv1.3\fP. |
| 4810 | .IP "\-\-tr-encoding" |
| 4811 | (HTTP) Request a compressed Transfer-Encoding response using one of the algorithms |
| 4812 | curl supports, and uncompress the data while receiving it. |
| 4813 | |
| 4814 | Providing --tr-encoding multiple times has no extra effect. |
| 4815 | Disable it again with --no-tr-encoding. |
| 4816 | |
| 4817 | Example: |
| 4818 | .nf |
| 4819 | curl --tr-encoding https://example.com |
| 4820 | .fi |
| 4821 | |
| 4822 | See also \fI--compressed\fP. |
| 4823 | .IP "\-\-trace-ascii <file>" |
| 4824 | Enables a full trace dump of all incoming and outgoing data, including |
| 4825 | descriptive information, to the given output file. Use "-" as filename to have |
| 4826 | the output sent to stdout. |
| 4827 | |
| 4828 | This is similar to \fI\-\-trace\fP, but leaves out the hex part and only shows the |
| 4829 | ASCII part of the dump. It makes smaller output that might be easier to read |
| 4830 | for untrained humans. |
| 4831 | |
| 4832 | This option is global and does not need to be specified for each use of |
| 4833 | \fI\-:, \-\-next\fP. |
| 4834 | |
| 4835 | If --trace-ascii is provided several times, the last set value will be used. |
| 4836 | |
| 4837 | Example: |
| 4838 | .nf |
| 4839 | curl --trace-ascii log.txt https://example.com |
| 4840 | .fi |
| 4841 | |
| 4842 | See also \fI-v, --verbose\fP and \fI--trace\fP. This option is mutually exclusive to \fI--trace\fP and \fI-v, --verbose\fP. |
| 4843 | .IP "\-\-trace-time" |
| 4844 | Prepends a time stamp to each trace or verbose line that curl displays. |
| 4845 | |
| 4846 | This option is global and does not need to be specified for each use of |
| 4847 | \fI\-:, \-\-next\fP. |
| 4848 | |
| 4849 | Providing --trace-time multiple times has no extra effect. |
| 4850 | Disable it again with --no-trace-time. |
| 4851 | |
| 4852 | Example: |
| 4853 | .nf |
| 4854 | curl --trace-time --trace-ascii output https://example.com |
| 4855 | .fi |
| 4856 | |
| 4857 | See also \fI--trace\fP and \fI-v, --verbose\fP. |
| 4858 | .IP "\-\-trace <file>" |
| 4859 | Enables a full trace dump of all incoming and outgoing data, including |
| 4860 | descriptive information, to the given output file. Use "-" as filename to have |
| 4861 | the output sent to stdout. Use "%" as filename to have the output sent to |
| 4862 | stderr. |
| 4863 | |
| 4864 | This option is global and does not need to be specified for each use of |
| 4865 | \fI\-:, \-\-next\fP. |
| 4866 | |
| 4867 | If --trace is provided several times, the last set value will be used. |
| 4868 | |
| 4869 | Example: |
| 4870 | .nf |
| 4871 | curl --trace log.txt https://example.com |
| 4872 | .fi |
| 4873 | |
| 4874 | See also \fI--trace-ascii\fP and \fI--trace-time\fP. This option is mutually exclusive to \fI-v, --verbose\fP and \fI--trace-ascii\fP. |
| 4875 | .IP "\-\-unix-socket <path>" |
| 4876 | (HTTP) Connect through this Unix domain socket, instead of using the network. |
| 4877 | |
| 4878 | If --unix-socket is provided several times, the last set value will be used. |
| 4879 | |
| 4880 | Example: |
| 4881 | .nf |
| 4882 | curl --unix-socket socket-path https://example.com |
| 4883 | .fi |
| 4884 | |
| 4885 | See also \fI--abstract-unix-socket\fP. Added in 7.40.0. |
| 4886 | .IP "\-T, \-\-upload-file <file>" |
| 4887 | This transfers the specified local file to the remote URL. If there is no file |
| 4888 | part in the specified URL, curl will append the local file name. NOTE that you |
| 4889 | must use a trailing / on the last directory to really prove to Curl that there |
| 4890 | is no file name or curl will think that your last directory name is the remote |
| 4891 | file name to use. That will most likely cause the upload operation to fail. If |
| 4892 | this is used on an HTTP(S) server, the PUT command will be used. |
| 4893 | |
| 4894 | Use the file name "-" (a single dash) to use stdin instead of a given file. |
| 4895 | Alternately, the file name "." (a single period) may be specified instead of |
| 4896 | \(dq-" to use stdin in non-blocking mode to allow reading server output while |
| 4897 | stdin is being uploaded. |
| 4898 | |
| 4899 | You can specify one \-\-upload-file for each URL on the command line. Each |
| 4900 | \fI\-T, \-\-upload-file\fP + URL pair specifies what to upload and to where. curl also |
| 4901 | supports "globbing" of the \-\-upload-file argument, meaning that you can upload |
| 4902 | multiple files to a single URL by using the same URL globbing style supported |
| 4903 | in the URL. |
| 4904 | |
| 4905 | When uploading to an SMTP server: the uploaded data is assumed to be RFC 5322 |
| 4906 | formatted. It has to feature the necessary set of headers and mail body |
| 4907 | formatted correctly by the user as curl will not transcode nor encode it |
| 4908 | further in any way. |
| 4909 | |
| 4910 | --upload-file can be used several times in a command line |
| 4911 | |
| 4912 | Examples: |
| 4913 | .nf |
| 4914 | curl -T file https://example.com |
| 4915 | curl -T "img[1-1000].png" ftp://ftp.example.com/ |
| 4916 | curl --upload-file "{file1,file2}" https://example.com |
| 4917 | .fi |
| 4918 | |
| 4919 | See also \fI-G, --get\fP and \fI-I, --head\fP. |
| 4920 | .IP "\-\-url <url>" |
| 4921 | Specify a URL to fetch. This option is mostly handy when you want to specify |
| 4922 | URL(s) in a config file. |
| 4923 | |
| 4924 | If the given URL is missing a scheme name (such as "http://" or "ftp://" etc) |
| 4925 | then curl will make a guess based on the host. If the outermost sub-domain |
| 4926 | name matches DICT, FTP, IMAP, LDAP, POP3 or SMTP then that protocol will be |
| 4927 | used, otherwise HTTP will be used. Since 7.45.0 guessing can be disabled by |
| 4928 | setting a default protocol, see \-\-proto-default for details. |
| 4929 | |
| 4930 | To control where this URL is written, use the \-\-output or the \-\-remote-name |
| 4931 | options. |
| 4932 | |
| 4933 | \fBWARNING\fP: On Windows, particular file:// accesses can be converted to |
| 4934 | network accesses by the operating system. Beware! |
| 4935 | |
| 4936 | --url can be used several times in a command line |
| 4937 | |
| 4938 | Example: |
| 4939 | .nf |
| 4940 | curl --url https://example.com |
| 4941 | .fi |
| 4942 | |
| 4943 | See also \fI-:, --next\fP and \fI-K, --config\fP. |
| 4944 | .IP "\-B, \-\-use-ascii" |
| 4945 | (FTP LDAP) Enable ASCII transfer. For FTP, this can also be enforced by using a URL that |
| 4946 | ends with ";type=A". This option causes data sent to stdout to be in text mode |
| 4947 | for win32 systems. |
| 4948 | |
| 4949 | Providing --use-ascii multiple times has no extra effect. |
| 4950 | Disable it again with --no-use-ascii. |
| 4951 | |
| 4952 | Example: |
| 4953 | .nf |
| 4954 | curl -B ftp://example.com/README |
| 4955 | .fi |
| 4956 | |
| 4957 | See also \fI--crlf\fP and \fI--data-ascii\fP. |
| 4958 | .IP "\-A, \-\-user-agent <name>" |
| 4959 | (HTTP) Specify the User-Agent string to send to the HTTP server. To encode blanks in |
| 4960 | the string, surround the string with single quote marks. This header can also |
| 4961 | be set with the \-\-header or the \-\-proxy-header options. |
| 4962 | |
| 4963 | If you give an empty argument to \fI\-A, \-\-user-agent\fP (""), it will remove the header |
| 4964 | completely from the request. If you prefer a blank header, you can set it to a |
| 4965 | single space (" "). |
| 4966 | |
| 4967 | If --user-agent is provided several times, the last set value will be used. |
| 4968 | |
| 4969 | Example: |
| 4970 | .nf |
| 4971 | curl -A "Agent 007" https://example.com |
| 4972 | .fi |
| 4973 | |
| 4974 | See also \fI-H, --header\fP and \fI--proxy-header\fP. |
| 4975 | .IP "\-u, \-\-user <user:password>" |
| 4976 | Specify the user name and password to use for server authentication. Overrides |
| 4977 | \-\-netrc and \fI\-\-netrc-optional\fP. |
| 4978 | |
| 4979 | If you simply specify the user name, curl will prompt for a password. |
| 4980 | |
| 4981 | The user name and passwords are split up on the first colon, which makes it |
| 4982 | impossible to use a colon in the user name with this option. The password can, |
| 4983 | still. |
| 4984 | |
| 4985 | On systems where it works, curl will hide the given option argument from |
| 4986 | process listings. This is not enough to protect credentials from possibly |
| 4987 | getting seen by other users on the same system as they will still be visible |
| 4988 | for a moment before cleared. Such sensitive data should be retrieved from a |
| 4989 | file instead or similar and never used in clear text in a command line. |
| 4990 | |
| 4991 | When using Kerberos V5 with a Windows based server you should include the |
| 4992 | Windows domain name in the user name, in order for the server to successfully |
| 4993 | obtain a Kerberos Ticket. If you do not, then the initial authentication |
| 4994 | handshake may fail. |
| 4995 | |
| 4996 | When using NTLM, the user name can be specified simply as the user name, |
| 4997 | without the domain, if there is a single domain and forest in your setup |
| 4998 | for example. |
| 4999 | |
| 5000 | To specify the domain name use either Down-Level Logon Name or UPN (User |
| 5001 | Principal Name) formats. For example, EXAMPLE\\user and user@example.com |
| 5002 | respectively. |
| 5003 | |
| 5004 | If you use a Windows SSPI-enabled curl binary and perform Kerberos V5, |
| 5005 | Negotiate, NTLM or Digest authentication then you can tell curl to select |
| 5006 | the user name and password from your environment by specifying a single colon |
| 5007 | with this option: "-u :". |
| 5008 | |
| 5009 | If --user is provided several times, the last set value will be used. |
| 5010 | |
| 5011 | Example: |
| 5012 | .nf |
| 5013 | curl -u user:secret https://example.com |
| 5014 | .fi |
| 5015 | |
| 5016 | See also \fI-n, --netrc\fP and \fI-K, --config\fP. |
| 5017 | .IP "\-v, \-\-verbose" |
| 5018 | Makes curl verbose during the operation. Useful for debugging and seeing |
| 5019 | what's going on "under the hood". A line starting with '>' means "header data" |
| 5020 | sent by curl, '<' means "header data" received by curl that is hidden in |
| 5021 | normal cases, and a line starting with '*' means additional info provided by |
| 5022 | curl. |
| 5023 | |
| 5024 | If you only want HTTP headers in the output, \-\-include might be the option |
| 5025 | you are looking for. |
| 5026 | |
| 5027 | If you think this option still does not give you enough details, consider using |
| 5028 | \-\-trace or \-\-trace-ascii instead. |
| 5029 | |
| 5030 | This option is global and does not need to be specified for each use of |
| 5031 | \fI\-:, \-\-next\fP. |
| 5032 | |
| 5033 | Use \-\-silent to make curl really quiet. |
| 5034 | |
| 5035 | Providing --verbose multiple times has no extra effect. |
| 5036 | Disable it again with --no-verbose. |
| 5037 | |
| 5038 | Example: |
| 5039 | .nf |
| 5040 | curl --verbose https://example.com |
| 5041 | .fi |
| 5042 | |
| 5043 | See also \fI-i, --include\fP. This option is mutually exclusive to \fI--trace\fP and \fI--trace-ascii\fP. |
| 5044 | .IP "\-V, \-\-version" |
| 5045 | Displays information about curl and the libcurl version it uses. |
| 5046 | |
| 5047 | The first line includes the full version of curl, libcurl and other 3rd party |
| 5048 | libraries linked with the executable. |
| 5049 | |
| 5050 | The second line (starts with "Protocols:") shows all protocols that libcurl |
| 5051 | reports to support. |
| 5052 | |
| 5053 | The third line (starts with "Features:") shows specific features libcurl |
| 5054 | reports to offer. Available features include: |
| 5055 | .RS |
| 5056 | .IP "alt-svc" |
| 5057 | Support for the Alt-Svc: header is provided. |
| 5058 | .IP "AsynchDNS" |
| 5059 | This curl uses asynchronous name resolves. Asynchronous name resolves can be |
| 5060 | done using either the c-ares or the threaded resolver backends. |
| 5061 | .IP "brotli" |
| 5062 | Support for automatic brotli compression over HTTP(S). |
| 5063 | .IP "CharConv" |
| 5064 | curl was built with support for character set conversions (like EBCDIC) |
| 5065 | .IP "Debug" |
| 5066 | This curl uses a libcurl built with Debug. This enables more error-tracking |
| 5067 | and memory debugging etc. For curl-developers only! |
| 5068 | .IP "gsasl" |
| 5069 | The built-in SASL authentication includes extensions to support SCRAM because |
| 5070 | libcurl was built with libgsasl. |
| 5071 | .IP "GSS-API" |
| 5072 | GSS-API is supported. |
| 5073 | .IP "HSTS" |
| 5074 | HSTS support is present. |
| 5075 | .IP "HTTP2" |
| 5076 | HTTP/2 support has been built-in. |
| 5077 | .IP "HTTP3" |
| 5078 | HTTP/3 support has been built-in. |
| 5079 | .IP "HTTPS-proxy" |
| 5080 | This curl is built to support HTTPS proxy. |
| 5081 | .IP "IDN" |
| 5082 | This curl supports IDN \- international domain names. |
| 5083 | .IP "IPv6" |
| 5084 | You can use IPv6 with this. |
| 5085 | .IP "Kerberos" |
| 5086 | Kerberos V5 authentication is supported. |
| 5087 | .IP "Largefile" |
| 5088 | This curl supports transfers of large files, files larger than 2GB. |
| 5089 | .IP "libz" |
| 5090 | Automatic decompression (via gzip, deflate) of compressed files over HTTP is |
| 5091 | supported. |
| 5092 | .IP "MultiSSL" |
| 5093 | This curl supports multiple TLS backends. |
| 5094 | .IP "NTLM" |
| 5095 | NTLM authentication is supported. |
| 5096 | .IP "NTLM_WB" |
| 5097 | NTLM delegation to winbind helper is supported. |
| 5098 | .IP "PSL" |
| 5099 | PSL is short for Public Suffix List and means that this curl has been built |
| 5100 | with knowledge about "public suffixes". |
| 5101 | .IP "SPNEGO" |
| 5102 | SPNEGO authentication is supported. |
| 5103 | .IP "SSL" |
| 5104 | SSL versions of various protocols are supported, such as HTTPS, FTPS, POP3S |
| 5105 | and so on. |
| 5106 | .IP "SSPI" |
| 5107 | SSPI is supported. |
| 5108 | .IP "TLS-SRP" |
| 5109 | SRP (Secure Remote Password) authentication is supported for TLS. |
| 5110 | .IP "TrackMemory" |
| 5111 | Debug memory tracking is supported. |
| 5112 | .IP "Unicode" |
| 5113 | Unicode support on Windows. |
| 5114 | .IP "UnixSockets" |
| 5115 | Unix sockets support is provided. |
| 5116 | .IP "zstd" |
| 5117 | Automatic decompression (via zstd) of compressed files over HTTP is supported. |
| 5118 | .RE |
| 5119 | |
| 5120 | Providing --version multiple times has no extra effect. |
| 5121 | Disable it again with --no-version. |
| 5122 | |
| 5123 | Example: |
| 5124 | .nf |
| 5125 | curl --version |
| 5126 | .fi |
| 5127 | |
| 5128 | See also \fI-h, --help\fP and \fI-M, --manual\fP. |
| 5129 | .IP "\-w, \-\-write-out <format>" |
| 5130 | Make curl display information on stdout after a completed transfer. The format |
| 5131 | is a string that may contain plain text mixed with any number of |
| 5132 | variables. The format can be specified as a literal "string", or you can have |
| 5133 | curl read the format from a file with "@filename" and to tell curl to read the |
| 5134 | format from stdin you write "@-". |
| 5135 | |
| 5136 | The variables present in the output format will be substituted by the value or |
| 5137 | text that curl thinks fit, as described below. All variables are specified as |
| 5138 | %{variable_name} and to output a normal % you just write them as %%. You can |
| 5139 | output a newline by using \\n, a carriage return with \\r and a tab space with |
| 5140 | \\t. |
| 5141 | |
| 5142 | The output will be written to standard output, but this can be switched to |
| 5143 | standard error by using %{stderr}. |
| 5144 | |
| 5145 | Output HTTP headers from the most recent request by using \fB%header{name}\fP |
| 5146 | where \fBname\fP is the case insensitive name of the header (without the |
| 5147 | trailing colon). The header contents are exactly as sent over the network, |
| 5148 | with leading and trailing whitespace trimmed. Added in curl 7.84.0. |
| 5149 | |
| 5150 | .B NOTE: |
| 5151 | The %-symbol is a special symbol in the win32-environment, where all |
| 5152 | occurrences of % must be doubled when using this option. |
| 5153 | |
| 5154 | The variables available are: |
| 5155 | .RS |
| 5156 | .TP 15 |
| 5157 | .B content_type |
| 5158 | The Content-Type of the requested document, if there was any. |
| 5159 | .TP |
| 5160 | .B errormsg |
| 5161 | The error message. (Added in 7.75.0) |
| 5162 | .TP |
| 5163 | .B exitcode |
| 5164 | The numerical exitcode of the transfer. (Added in 7.75.0) |
| 5165 | .TP |
| 5166 | .B filename_effective |
| 5167 | The ultimate filename that curl writes out to. This is only meaningful if curl |
| 5168 | is told to write to a file with the \-\-remote-name or \-\-output |
| 5169 | option. It's most useful in combination with the \-\-remote-header-name |
| 5170 | option. |
| 5171 | .TP |
| 5172 | .B ftp_entry_path |
| 5173 | The initial path curl ended up in when logging on to the remote FTP |
| 5174 | server. |
| 5175 | .TP |
| 5176 | .B header_json |
| 5177 | A JSON object with all HTTP response headers from the recent transfer. Values |
| 5178 | are provided as arrays, since in the case of multiple headers there can be |
| 5179 | multiple values. |
| 5180 | |
| 5181 | The header names provided in lowercase, listed in order of appearance over the |
| 5182 | wire. Except for duplicated headers. They are grouped on the first occurrence |
| 5183 | of that header, each value is presented in the JSON array. |
| 5184 | .TP |
| 5185 | .B http_code |
| 5186 | The numerical response code that was found in the last retrieved HTTP(S) or |
| 5187 | FTP(s) transfer. |
| 5188 | .TP |
| 5189 | .B http_connect |
| 5190 | The numerical code that was found in the last response (from a proxy) to a |
| 5191 | curl CONNECT request. |
| 5192 | .TP |
| 5193 | .B http_version |
| 5194 | The http version that was effectively used. (Added in 7.50.0) |
| 5195 | .TP |
| 5196 | .B json |
| 5197 | A JSON object with all available keys. |
| 5198 | .TP |
| 5199 | .B local_ip |
| 5200 | The IP address of the local end of the most recently done connection \- can be |
| 5201 | either IPv4 or IPv6. |
| 5202 | .TP |
| 5203 | .B local_port |
| 5204 | The local port number of the most recently done connection. |
| 5205 | .TP |
| 5206 | .B method |
| 5207 | The http method used in the most recent HTTP request. (Added in 7.72.0) |
| 5208 | .TP |
| 5209 | .B num_connects |
| 5210 | Number of new connects made in the recent transfer. |
| 5211 | .TP |
| 5212 | .B num_headers |
| 5213 | The number of response headers in the most recent request (restarted at each |
| 5214 | redirect). Note that the status line IS NOT a header. (Added in 7.73.0) |
| 5215 | .TP |
| 5216 | .B num_redirects |
| 5217 | Number of redirects that were followed in the request. |
| 5218 | .TP |
| 5219 | .B onerror |
| 5220 | The rest of the output is only shown if the transfer returned a non-zero error |
| 5221 | (Added in 7.75.0) |
| 5222 | .TP |
| 5223 | .B proxy_ssl_verify_result |
| 5224 | The result of the HTTPS proxy's SSL peer certificate verification that was |
| 5225 | requested. 0 means the verification was successful. (Added in 7.52.0) |
| 5226 | .TP |
| 5227 | .B redirect_url |
| 5228 | When an HTTP request was made without \-\-location to follow redirects (or when |
| 5229 | \-\-max-redirs is met), this variable will show the actual URL a redirect |
| 5230 | \fIwould\fP have gone to. |
| 5231 | .TP |
| 5232 | .B referer |
| 5233 | The Referer: header, if there was any. (Added in 7.76.0) |
| 5234 | .TP |
| 5235 | .B remote_ip |
| 5236 | The remote IP address of the most recently done connection \- can be either |
| 5237 | IPv4 or IPv6. |
| 5238 | .TP |
| 5239 | .B remote_port |
| 5240 | The remote port number of the most recently done connection. |
| 5241 | .TP |
| 5242 | .B response_code |
| 5243 | The numerical response code that was found in the last transfer (formerly |
| 5244 | known as "http_code"). |
| 5245 | .TP |
| 5246 | .B scheme |
| 5247 | The URL scheme (sometimes called protocol) that was effectively used. (Added in 7.52.0) |
| 5248 | .TP |
| 5249 | .B size_download |
| 5250 | The total amount of bytes that were downloaded. This is the size of the |
| 5251 | body/data that was transferred, excluding headers. |
| 5252 | .TP |
| 5253 | .B size_header |
| 5254 | The total amount of bytes of the downloaded headers. |
| 5255 | .TP |
| 5256 | .B size_request |
| 5257 | The total amount of bytes that were sent in the HTTP request. |
| 5258 | .TP |
| 5259 | .B size_upload |
| 5260 | The total amount of bytes that were uploaded. This is the size of the |
| 5261 | body/data that was transferred, excluding headers. |
| 5262 | .TP |
| 5263 | .B speed_download |
| 5264 | The average download speed that curl measured for the complete download. Bytes |
| 5265 | per second. |
| 5266 | .TP |
| 5267 | .B speed_upload |
| 5268 | The average upload speed that curl measured for the complete upload. Bytes per |
| 5269 | second. |
| 5270 | .TP |
| 5271 | .B ssl_verify_result |
| 5272 | The result of the SSL peer certificate verification that was requested. 0 |
| 5273 | means the verification was successful. |
| 5274 | .TP |
| 5275 | .B stderr |
| 5276 | From this point on, the \-\-write-out output will be written to standard |
| 5277 | error. (Added in 7.63.0) |
| 5278 | .TP |
| 5279 | .B stdout |
| 5280 | From this point on, the \-\-write-out output will be written to standard output. |
| 5281 | This is the default, but can be used to switch back after switching to stderr. |
| 5282 | (Added in 7.63.0) |
| 5283 | .TP |
| 5284 | .B time_appconnect |
| 5285 | The time, in seconds, it took from the start until the SSL/SSH/etc |
| 5286 | connect/handshake to the remote host was completed. |
| 5287 | .TP |
| 5288 | .B time_connect |
| 5289 | The time, in seconds, it took from the start until the TCP connect to the |
| 5290 | remote host (or proxy) was completed. |
| 5291 | .TP |
| 5292 | .B time_namelookup |
| 5293 | The time, in seconds, it took from the start until the name resolving was |
| 5294 | completed. |
| 5295 | .TP |
| 5296 | .B time_pretransfer |
| 5297 | The time, in seconds, it took from the start until the file transfer was just |
| 5298 | about to begin. This includes all pre-transfer commands and negotiations that |
| 5299 | are specific to the particular protocol(s) involved. |
| 5300 | .TP |
| 5301 | .B time_redirect |
| 5302 | The time, in seconds, it took for all redirection steps including name lookup, |
| 5303 | connect, pretransfer and transfer before the final transaction was |
| 5304 | started. time_redirect shows the complete execution time for multiple |
| 5305 | redirections. |
| 5306 | .TP |
| 5307 | .B time_starttransfer |
| 5308 | The time, in seconds, it took from the start until the first byte was just |
| 5309 | about to be transferred. This includes time_pretransfer and also the time the |
| 5310 | server needed to calculate the result. |
| 5311 | .TP |
| 5312 | .B time_total |
| 5313 | The total time, in seconds, that the full operation lasted. |
| 5314 | .TP |
| 5315 | .B url |
| 5316 | The URL that was fetched. (Added in 7.75.0) |
| 5317 | .TP |
| 5318 | .B urlnum |
| 5319 | The URL index number of this transfer, 0-indexed. De-globbed URLs share the |
| 5320 | same index number as the origin globbed URL. (Added in 7.75.0) |
| 5321 | .TP |
| 5322 | .B url_effective |
| 5323 | The URL that was fetched last. This is most meaningful if you have told curl |
| 5324 | to follow location: headers. |
| 5325 | .RE |
| 5326 | .IP |
| 5327 | |
| 5328 | If --write-out is provided several times, the last set value will be used. |
| 5329 | |
| 5330 | Example: |
| 5331 | .nf |
| 5332 | curl -w '%{http_code}\\n' https://example.com |
| 5333 | .fi |
| 5334 | |
| 5335 | See also \fI-v, --verbose\fP and \fI-I, --head\fP. |
| 5336 | .IP "\-\-xattr" |
| 5337 | When saving output to a file, this option tells curl to store certain file |
| 5338 | metadata in extended file attributes. Currently, the URL is stored in the |
| 5339 | xdg.origin.url attribute and, for HTTP, the content type is stored in |
| 5340 | the mime_type attribute. If the file system does not support extended |
| 5341 | attributes, a warning is issued. |
| 5342 | |
| 5343 | Providing --xattr multiple times has no extra effect. |
| 5344 | Disable it again with --no-xattr. |
| 5345 | |
| 5346 | Example: |
| 5347 | .nf |
| 5348 | curl --xattr -o storage https://example.com |
| 5349 | .fi |
| 5350 | |
| 5351 | See also \fI-R, --remote-time\fP, \fI-w, --write-out\fP and \fI-v, --verbose\fP. |
| 5352 | .SH FILES |
| 5353 | .I ~/.curlrc |
| 5354 | .RS |
| 5355 | Default config file, see \-\-config for details. |
| 5356 | .SH ENVIRONMENT |
| 5357 | The environment variables can be specified in lower case or upper case. The |
| 5358 | lower case version has precedence. http_proxy is an exception as it is only |
| 5359 | available in lower case. |
| 5360 | |
| 5361 | Using an environment variable to set the proxy has the same effect as using |
| 5362 | the \-\-proxy option. |
| 5363 | |
| 5364 | .IP "http_proxy [protocol://]<host>[:port]" |
| 5365 | Sets the proxy server to use for HTTP. |
| 5366 | .IP "HTTPS_PROXY [protocol://]<host>[:port]" |
| 5367 | Sets the proxy server to use for HTTPS. |
| 5368 | .IP "[url-protocol]_PROXY [protocol://]<host>[:port]" |
| 5369 | Sets the proxy server to use for [url-protocol], where the protocol is a |
| 5370 | protocol that curl supports and as specified in a URL. FTP, FTPS, POP3, IMAP, |
| 5371 | SMTP, LDAP, etc. |
| 5372 | .IP "ALL_PROXY [protocol://]<host>[:port]" |
| 5373 | Sets the proxy server to use if no protocol-specific proxy is set. |
| 5374 | .IP "NO_PROXY <comma-separated list of hosts/domains>" |
| 5375 | list of host names that should not go through any proxy. If set to an asterisk |
| 5376 | \(aq*' only, it matches all hosts. Each name in this list is matched as either |
| 5377 | a domain name which contains the hostname, or the hostname itself. |
| 5378 | |
| 5379 | This environment variable disables use of the proxy even when specified with |
| 5380 | the \-\-proxy option. That is |
| 5381 | .B NO_PROXY=direct.example.com curl \-x http://proxy.example.com |
| 5382 | .B http://direct.example.com |
| 5383 | accesses the target URL directly, and |
| 5384 | .B NO_PROXY=direct.example.com curl \-x http://proxy.example.com |
| 5385 | .B http://somewhere.example.com |
| 5386 | accesses the target URL through the proxy. |
| 5387 | |
| 5388 | The list of host names can also be include numerical IP addresses, and IPv6 |
| 5389 | versions should then be given without enclosing brackets. |
| 5390 | |
| 5391 | IPv6 numerical addresses are compared as strings, so they will only match if |
| 5392 | the representations are the same: "::1" is the same as "::0:1" but they do not |
| 5393 | match. |
| 5394 | .IP "APPDATA <dir>" |
| 5395 | On Windows, this variable is used when trying to find the home directory. If |
| 5396 | the primary home variable are all unset. |
| 5397 | .IP "COLUMNS <terminal width>" |
| 5398 | If set, the specified number of characters will be used as the terminal width |
| 5399 | when the alternative progress-bar is shown. If not set, curl will try to |
| 5400 | figure it out using other ways. |
| 5401 | .IP "CURL_CA_BUNDLE <file>" |
| 5402 | If set, will be used as the \fI\-\-cacert\fP value. |
| 5403 | .IP "CURL_HOME <dir>" |
| 5404 | If set, is the first variable curl checks when trying to find its home |
| 5405 | directory. If not set, it continues to check \fBXDG_CONFIG_HOME\fP. |
| 5406 | .IP "CURL_SSL_BACKEND <TLS backend>" |
| 5407 | If curl was built with support for "MultiSSL", meaning that it has built-in |
| 5408 | support for more than one TLS backend, this environment variable can be set to |
| 5409 | the case insensitive name of the particular backend to use when curl is |
| 5410 | invoked. Setting a name that is not a built-in alternative will make curl |
| 5411 | stay with the default. |
| 5412 | |
| 5413 | SSL backend names (case-insensitive): bearssl, gnutls, gskit, mbedtls, |
| 5414 | nss, openssl, rustls, schannel, secure-transport, wolfssl |
| 5415 | .IP "HOME <dir>" |
| 5416 | If set, this is used to find the home directory when that is needed. Like when |
| 5417 | looking for the default .curlrc. \fBCURL_HOME\fP and \fBXDG_CONFIG_HOME\fP |
| 5418 | have preference. |
| 5419 | .IP "QLOGDIR <directory name>" |
| 5420 | If curl was built with HTTP/3 support, setting this environment variable to a |
| 5421 | local directory will make curl produce qlogs in that directory, using file |
| 5422 | names named after the destination connection id (in hex). Do note that these |
| 5423 | files can become rather large. Works with both QUIC backends. |
| 5424 | .IP SHELL |
| 5425 | Used on VMS when trying to detect if using a DCL or a "unix" shell. |
| 5426 | .IP "SSL_CERT_DIR <dir>" |
| 5427 | If set, will be used as the \fI\-\-capath\fP value. |
| 5428 | .IP "SSL_CERT_FILE <path>" |
| 5429 | If set, will be used as the \fI\-\-cacert\fP value. |
| 5430 | .IP "SSLKEYLOGFILE <file name>" |
| 5431 | If you set this environment variable to a file name, curl will store TLS |
| 5432 | secrets from its connections in that file when invoked to enable you to |
| 5433 | analyze the TLS traffic in real time using network analyzing tools such as |
| 5434 | Wireshark. This works with the following TLS backends: OpenSSL, libressl, |
| 5435 | BoringSSL, GnuTLS, NSS and wolfSSL. |
| 5436 | .IP "USERPROFILE <dir>" |
| 5437 | On Windows, this variable is used when trying to find the home directory. If |
| 5438 | the other, primary, variable are all unset. If set, curl will use the path |
| 5439 | \(dq$USERPROFILE\\Application Data". |
| 5440 | .IP "XDG_CONFIG_HOME <dir>" |
| 5441 | If \fBCURL_HOME\fP is not set, this variable is checked when looking for a |
| 5442 | default .curlrc file. |
| 5443 | .SH "PROXY PROTOCOL PREFIXES" |
| 5444 | The proxy string may be specified with a protocol:// prefix to specify |
| 5445 | alternative proxy protocols. |
| 5446 | |
| 5447 | If no protocol is specified in the proxy string or if the string does not match |
| 5448 | a supported one, the proxy will be treated as an HTTP proxy. |
| 5449 | |
| 5450 | The supported proxy protocol prefixes are as follows: |
| 5451 | .IP "http://" |
| 5452 | Makes it use it as an HTTP proxy. The default if no scheme prefix is used. |
| 5453 | .IP "https://" |
| 5454 | Makes it treated as an \fBHTTPS\fP proxy. |
| 5455 | .IP "socks4://" |
| 5456 | Makes it the equivalent of \-\-socks4 |
| 5457 | .IP "socks4a://" |
| 5458 | Makes it the equivalent of \-\-socks4a |
| 5459 | .IP "socks5://" |
| 5460 | Makes it the equivalent of \-\-socks5 |
| 5461 | .IP "socks5h://" |
| 5462 | Makes it the equivalent of \-\-socks5-hostname |
| 5463 | .SH EXIT CODES |
| 5464 | There are a bunch of different error codes and their corresponding error |
| 5465 | messages that may appear under error conditions. At the time of this writing, |
| 5466 | the exit codes are: |
| 5467 | .IP 0 |
| 5468 | Success. The operation completed successfully according to the instructions. |
| 5469 | .IP 1 |
| 5470 | Unsupported protocol. This build of curl has no support for this protocol. |
| 5471 | .IP 2 |
| 5472 | Failed to initialize. |
| 5473 | .IP 3 |
| 5474 | URL malformed. The syntax was not correct. |
| 5475 | .IP 4 |
| 5476 | A feature or option that was needed to perform the desired request was not |
| 5477 | enabled or was explicitly disabled at build-time. To make curl able to do |
| 5478 | this, you probably need another build of libcurl. |
| 5479 | .IP 5 |
| 5480 | Could not resolve proxy. The given proxy host could not be resolved. |
| 5481 | .IP 6 |
| 5482 | Could not resolve host. The given remote host could not be resolved. |
| 5483 | .IP 7 |
| 5484 | Failed to connect to host. |
| 5485 | .IP 8 |
| 5486 | Weird server reply. The server sent data curl could not parse. |
| 5487 | .IP 9 |
| 5488 | FTP access denied. The server denied login or denied access to the particular |
| 5489 | resource or directory you wanted to reach. Most often you tried to change to a |
| 5490 | directory that does not exist on the server. |
| 5491 | .IP 10 |
| 5492 | FTP accept failed. While waiting for the server to connect back when an active |
| 5493 | FTP session is used, an error code was sent over the control connection or |
| 5494 | similar. |
| 5495 | .IP 11 |
| 5496 | FTP weird PASS reply. Curl could not parse the reply sent to the PASS request. |
| 5497 | .IP 12 |
| 5498 | During an active FTP session while waiting for the server to connect back to |
| 5499 | curl, the timeout expired. |
| 5500 | .IP 13 |
| 5501 | FTP weird PASV reply, Curl could not parse the reply sent to the PASV request. |
| 5502 | .IP 14 |
| 5503 | FTP weird 227 format. Curl could not parse the 227-line the server sent. |
| 5504 | .IP 15 |
| 5505 | FTP cannot use host. Could not resolve the host IP we got in the 227-line. |
| 5506 | .IP 16 |
| 5507 | HTTP/2 error. A problem was detected in the HTTP2 framing layer. This is |
| 5508 | somewhat generic and can be one out of several problems, see the error message |
| 5509 | for details. |
| 5510 | .IP 17 |
| 5511 | FTP could not set binary. Could not change transfer method to binary. |
| 5512 | .IP 18 |
| 5513 | Partial file. Only a part of the file was transferred. |
| 5514 | .IP 19 |
| 5515 | FTP could not download/access the given file, the RETR (or similar) command |
| 5516 | failed. |
| 5517 | .IP 21 |
| 5518 | FTP quote error. A quote command returned error from the server. |
| 5519 | .IP 22 |
| 5520 | HTTP page not retrieved. The requested URL was not found or returned another |
| 5521 | error with the HTTP error code being 400 or above. This return code only |
| 5522 | appears if \-\-fail is used. |
| 5523 | .IP 23 |
| 5524 | Write error. Curl could not write data to a local filesystem or similar. |
| 5525 | .IP 25 |
| 5526 | FTP could not STOR file. The server denied the STOR operation, used for FTP |
| 5527 | uploading. |
| 5528 | .IP 26 |
| 5529 | Read error. Various reading problems. |
| 5530 | .IP 27 |
| 5531 | Out of memory. A memory allocation request failed. |
| 5532 | .IP 28 |
| 5533 | Operation timeout. The specified time-out period was reached according to the |
| 5534 | conditions. |
| 5535 | .IP 30 |
| 5536 | FTP PORT failed. The PORT command failed. Not all FTP servers support the PORT |
| 5537 | command, try doing a transfer using PASV instead! |
| 5538 | .IP 31 |
| 5539 | FTP could not use REST. The REST command failed. This command is used for |
| 5540 | resumed FTP transfers. |
| 5541 | .IP 33 |
| 5542 | HTTP range error. The range "command" did not work. |
| 5543 | .IP 34 |
| 5544 | HTTP post error. Internal post-request generation error. |
| 5545 | .IP 35 |
| 5546 | SSL connect error. The SSL handshaking failed. |
| 5547 | .IP 36 |
| 5548 | Bad download resume. Could not continue an earlier aborted download. |
| 5549 | .IP 37 |
| 5550 | FILE could not read file. Failed to open the file. Permissions? |
| 5551 | .IP 38 |
| 5552 | LDAP cannot bind. LDAP bind operation failed. |
| 5553 | .IP 39 |
| 5554 | LDAP search failed. |
| 5555 | .IP 41 |
| 5556 | Function not found. A required LDAP function was not found. |
| 5557 | .IP 42 |
| 5558 | Aborted by callback. An application told curl to abort the operation. |
| 5559 | .IP 43 |
| 5560 | Internal error. A function was called with a bad parameter. |
| 5561 | .IP 45 |
| 5562 | Interface error. A specified outgoing interface could not be used. |
| 5563 | .IP 47 |
| 5564 | Too many redirects. When following redirects, curl hit the maximum amount. |
| 5565 | .IP 48 |
| 5566 | Unknown option specified to libcurl. This indicates that you passed a weird |
| 5567 | option to curl that was passed on to libcurl and rejected. Read up in the |
| 5568 | manual! |
| 5569 | .IP 49 |
| 5570 | Malformed telnet option. |
| 5571 | .IP 52 |
| 5572 | The server did not reply anything, which here is considered an error. |
| 5573 | .IP 53 |
| 5574 | SSL crypto engine not found. |
| 5575 | .IP 54 |
| 5576 | Cannot set SSL crypto engine as default. |
| 5577 | .IP 55 |
| 5578 | Failed sending network data. |
| 5579 | .IP 56 |
| 5580 | Failure in receiving network data. |
| 5581 | .IP 58 |
| 5582 | Problem with the local certificate. |
| 5583 | .IP 59 |
| 5584 | Could not use specified SSL cipher. |
| 5585 | .IP 60 |
| 5586 | Peer certificate cannot be authenticated with known CA certificates. |
| 5587 | .IP 61 |
| 5588 | Unrecognized transfer encoding. |
| 5589 | .IP 63 |
| 5590 | Maximum file size exceeded. |
| 5591 | .IP 64 |
| 5592 | Requested FTP SSL level failed. |
| 5593 | .IP 65 |
| 5594 | Sending the data requires a rewind that failed. |
| 5595 | .IP 66 |
| 5596 | Failed to initialise SSL Engine. |
| 5597 | .IP 67 |
| 5598 | The user name, password, or similar was not accepted and curl failed to log in. |
| 5599 | .IP 68 |
| 5600 | File not found on TFTP server. |
| 5601 | .IP 69 |
| 5602 | Permission problem on TFTP server. |
| 5603 | .IP 70 |
| 5604 | Out of disk space on TFTP server. |
| 5605 | .IP 71 |
| 5606 | Illegal TFTP operation. |
| 5607 | .IP 72 |
| 5608 | Unknown TFTP transfer ID. |
| 5609 | .IP 73 |
| 5610 | File already exists (TFTP). |
| 5611 | .IP 74 |
| 5612 | No such user (TFTP). |
| 5613 | .IP 77 |
| 5614 | Problem reading the SSL CA cert (path? access rights?). |
| 5615 | .IP 78 |
| 5616 | The resource referenced in the URL does not exist. |
| 5617 | .IP 79 |
| 5618 | An unspecified error occurred during the SSH session. |
| 5619 | .IP 80 |
| 5620 | Failed to shut down the SSL connection. |
| 5621 | .IP 82 |
| 5622 | Could not load CRL file, missing or wrong format. |
| 5623 | .IP 83 |
| 5624 | Issuer check failed. |
| 5625 | .IP 84 |
| 5626 | The FTP PRET command failed. |
| 5627 | .IP 85 |
| 5628 | Mismatch of RTSP CSeq numbers. |
| 5629 | .IP 86 |
| 5630 | Mismatch of RTSP Session Identifiers. |
| 5631 | .IP 87 |
| 5632 | Unable to parse FTP file list. |
| 5633 | .IP 88 |
| 5634 | FTP chunk callback reported error. |
| 5635 | .IP 89 |
| 5636 | No connection available, the session will be queued. |
| 5637 | .IP 90 |
| 5638 | SSL public key does not matched pinned public key. |
| 5639 | .IP 91 |
| 5640 | Invalid SSL certificate status. |
| 5641 | .IP 92 |
| 5642 | Stream error in HTTP/2 framing layer. |
| 5643 | .IP 93 |
| 5644 | An API function was called from inside a callback. |
| 5645 | .IP 94 |
| 5646 | An authentication function returned an error. |
| 5647 | .IP 95 |
| 5648 | A problem was detected in the HTTP/3 layer. This is somewhat generic and can |
| 5649 | be one out of several problems, see the error message for details. |
| 5650 | .IP 96 |
| 5651 | QUIC connection error. This error may be caused by an SSL library error. QUIC |
| 5652 | is the protocol used for HTTP/3 transfers. |
| 5653 | .IP XX |
| 5654 | More error codes will appear here in future releases. The existing ones |
| 5655 | are meant to never change. |
| 5656 | .SH BUGS |
| 5657 | If you experience any problems with curl, submit an issue in the project's bug |
| 5658 | tracker on GitHub: https://github.com/curl/curl/issues |
| 5659 | .SH AUTHORS / CONTRIBUTORS |
| 5660 | Daniel Stenberg is the main author, but the whole list of contributors is |
| 5661 | found in the separate THANKS file. |
| 5662 | .SH WWW |
| 5663 | https://curl.se |
| 5664 | .SH "SEE ALSO" |
| 5665 | .BR ftp (1), |
| 5666 | .BR wget (1) |