CINXE.COM
curl - How To Use
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>curl - How To Use</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"> <link rel="stylesheet" type="text/css" href="/curl.css"> <link rel="shortcut icon" href="/favicon.ico"> <link rel="icon" href="/logo/curl-symbol.svg" type="image/svg+xml"> <link rel="alternate" type="application/rss+xml" title="cURL Releases" href="https://github.com/curl/curl/releases.atom"> <link rel="stylesheet" type="text/css" href="/manpage.css"> </head> <body> <div class="main"> <div class="menu"> <a href="/docs/" class="menuitem" title="Documentation Overview">Docs Overview</a> <div class="dropdown"> <a class="dropbtn" href="/docs/projdocs.html">Project</a> <div class="dropdown-content"> <a href="/docs/bugbounty.html">Bug Bounty</a> <a href="/docs/bugs.html">Bug Report</a> <a href="/docs/code-of-conduct.html">Code of conduct</a> <a href="/docs/libs.html">Dependencies</a> <a href="/donation.html">Donate</a> <a href="/docs/faq.html">FAQ</a> <a href="/docs/features.html">Features</a> <a href="/docs/governance.html">Governance</a> <a href="/docs/history.html">History</a> <a href="/docs/install.html">Install</a> <a href="/docs/knownbugs.html">Known Bugs</a> <a href="/logo/">Logo</a> <a href="/docs/todo.html">TODO</a> <a href="/about.html">website Info</a> </div> </div> <div class="dropdown"> <a class="dropbtn" href="/docs/protdocs.html">Protocols</a> <div class="dropdown-content"> <a href="/docs/caextract.html">CA Extract</a> <a href="/docs/http-cookies.html">HTTP cookies</a> <a href="/docs/http3.html">HTTP/3</a> <a href="/docs/mqtt.html">MQTT</a> <a href="/docs/sslcerts.html">SSL certs</a> <a href="/docs/ssl-compared.html">SSL libs compared</a> <a href="/docs/url-syntax.html">URL syntax</a> <a href="/docs/websocket.html">WebSocket</a> </div> </div> <div class="dropdown"> <a class="dropbtn" href="/docs/reldocs.html">Releases</a> <div class="dropdown-content"> <a href="/ch/">Changelog</a> <a href="/docs/security.html">curl CVEs</a> <a href="/docs/releases.html">Release Table</a> <a href="/docs/versions.html">Version Numbering</a> <a href="/docs/vulnerabilities.html">Vulnerabilities</a> </div> </div> <div class="dropdown"> <a class="dropbtn" href="/docs/tooldocs.html">Tool</a> <div class="dropdown-content"> <a href="/docs/comparison-table.html">Comparison Table</a> <a href="/docs/manpage.html">curl man page</a> <a href="/docs/httpscripting.html">HTTP Scripting</a> <a href="/docs/mk-ca-bundle.html">mk-ca-bundle</a> <a href="/docs/tutorial.html">Tutorial</a> <a href="optionswhen.html">When options were added</a> </div> </div> <div class="dropdown"> <a class="dropbtn" href="/docs/whodocs.html">Who and Why</a> <div class="dropdown-content"> <a href="/docs/companies.html">Companies</a> <a href="/docs/copyright.html">Copyright</a> <a href="/sponsors.html">Sponsors</a> <a href="/docs/thanks.html">Thanks</a> <a href="/docs/thename.html">The name</a> </div> </div> </div> <div class="contents"> <!-- styles needed for option menu. --> <style> /* Allow current .menu class to use z-index property. */ /* Enabling z-index puts option menu to back of top navigaiton menu. */ div.menu { position: relative; /* enable z-index */ z-index: 2; /* puts nav menu in front of option menu */ } /* Re-style option dropdown a bit. Mainly to a fixed position. */ div#opt-dropdown.dropdown { position: fixed; top: 0px; left: 0px; max-width: -webkit-fill-available; min-width: 200px; background-color: white; font-size: 12pt; text-align: center; z-index: 1; } /* Allow padding for text "Options" - more readable. */ div#opt-dropdown div.dropbtn { padding: 4px; } /* Hide checkbox elements. */ div#opt-dropdown.dropdown > .pinoptions { display: none; margin-top: 6px; /* make chcckbox less cramped, more readable */ } /* Show checkbox .dropdown when hovered, and when checkbox is checked. */ div#opt-dropdown.dropdown:hover .pinoptions, div#opt-dropdown.dropdown > input.pinoptions:checked, div#opt-dropdown.dropdown > input.pinoptions:checked + label.pinoptions { display: initial; } /* Hide resize instruction initially. */ div#opt-dropdown.dropdown div.dropdown-content small { display: none; } /* Make options more readable. */ div#opt-dropdown.dropdown div.dropdown-content a { font-size: 14pt; } /* Keep option menu expanded when checkbox checked, showing resize instructions. */ input.pinoptions:checked + label.pinoptions + div.dropdown-content, div#opt-dropdown.dropdown input.pinoptions:checked + label.pinoptions + div.dropdown-content small { display: block; } /* Restyle contents when checked to stay left, top into view, size, and allow resizing. */ input.pinoptions:checked + label.pinoptions + div.dropdown-content { display: block; top: 40px; left: 0px; margin-top: 10px; resize: both; } /* Make .dropdown-content 95% of viewport height and scrollable. */ div#opt-dropdown.dropdown:hover div.dropdown-content, input.pinoptions:checked + label.pinoptions + div.dropdown-content { overflow-y: scroll; max-height: 90vh; /* ensure browser shows bottom protion */ min-height: 100px; max-width: 300px; } /* Add end marker puttting bottom options better in view. */ /* Also indicates end of option list. */ div#opt-dropdown.dropdown div.dropdown-content:after { content: ""; display: inline-block; position: relative; height: 50px; width: 100%; margin-top: 10px; margin-left: -5px; border-right: 1px solid #0a3754; background-color: white; background-image: url("https://curl.se/logo/curl-logo.svg"); background-repeat: no-repeat; background-size: 50%; background-position: 50% 40%; color: white; } @media (prefers-color-scheme: dark) { div#opt-dropdown.dropdown { color: #222; } div#opt-dropdown.dropdown div.dropdown-content:after { color: #222; } } </style> <!-- Start option menu. --> <div id="opt-dropdown" class="dropdown"> <div class="dropbtn">Options</div> <input type="checkbox" class="pinoptions" id="pinoptions"> <!-- stay expanded when checked --> <label class="pinoptions" for="pinoptions">Keep Expanded</label> <div class="dropdown-content"> <small style="padding: 5px 0">Bottom right handle resizes.</small> <hr> <!-- indicator for start of list that is parsed from template generated in makefile --> <a href="#--abstract-unix-socket">--abstract-unix-socket</a> <a href="#--alt-svc">--alt-svc</a> <a href="#--anyauth">--anyauth</a> <a href="#-a">-a, --append</a> <a href="#--aws-sigv4">--aws-sigv4</a> <a href="#--basic">--basic</a> <a href="#--ca-native">--ca-native</a> <a href="#--cacert">--cacert</a> <a href="#--capath">--capath</a> <a href="#-E">-E, --cert</a> <a href="#--cert-status">--cert-status</a> <a href="#--cert-type">--cert-type</a> <a href="#--ciphers">--ciphers</a> <a href="#--compressed">--compressed</a> <a href="#--compressed-ssh">--compressed-ssh</a> <a href="#-K">-K, --config</a> <a href="#--connect-timeout">--connect-timeout</a> <a href="#--connect-to">--connect-to</a> <a href="#-C">-C, --continue-at</a> <a href="#-b">-b, --cookie</a> <a href="#-c">-c, --cookie-jar</a> <a href="#--create-dirs">--create-dirs</a> <a href="#--create-file-mode">--create-file-mode</a> <a href="#--crlf">--crlf</a> <a href="#--crlfile">--crlfile</a> <a href="#--curves">--curves</a> <a href="#-d">-d, --data</a> <a href="#--data-ascii">--data-ascii</a> <a href="#--data-binary">--data-binary</a> <a href="#--data-raw">--data-raw</a> <a href="#--data-urlencode">--data-urlencode</a> <a href="#--delegation">--delegation</a> <a href="#--digest">--digest</a> <a href="#-q">-q, --disable</a> <a href="#--disable-eprt">--disable-eprt</a> <a href="#--disable-epsv">--disable-epsv</a> <a href="#--disallow-username-in-url">--disallow-username-in-url</a> <a href="#--dns-interface">--dns-interface</a> <a href="#--dns-ipv4-addr">--dns-ipv4-addr</a> <a href="#--dns-ipv6-addr">--dns-ipv6-addr</a> <a href="#--dns-servers">--dns-servers</a> <a href="#--doh-cert-status">--doh-cert-status</a> <a href="#--doh-insecure">--doh-insecure</a> <a href="#--doh-url">--doh-url</a> <a href="#-D">-D, --dump-header</a> <a href="#--egd-file">--egd-file</a> <a href="#--engine">--engine</a> <a href="#--etag-compare">--etag-compare</a> <a href="#--etag-save">--etag-save</a> <a href="#--expect100-timeout">--expect100-timeout</a> <a href="#-f">-f, --fail</a> <a href="#--fail-early">--fail-early</a> <a href="#--fail-with-body">--fail-with-body</a> <a href="#--false-start">--false-start</a> <a href="#-F">-F, --form</a> <a href="#--form-escape">--form-escape</a> <a href="#--form-string">--form-string</a> <a href="#--ftp-account">--ftp-account</a> <a href="#--ftp-alternative-to-user">--ftp-alternative-to-user</a> <a href="#--ftp-create-dirs">--ftp-create-dirs</a> <a href="#--ftp-method">--ftp-method</a> <a href="#--ftp-pasv">--ftp-pasv</a> <a href="#-P">-P, --ftp-port</a> <a href="#--ftp-pret">--ftp-pret</a> <a href="#--ftp-skip-pasv-ip">--ftp-skip-pasv-ip</a> <a href="#--ftp-ssl-ccc">--ftp-ssl-ccc</a> <a href="#--ftp-ssl-ccc-mode">--ftp-ssl-ccc-mode</a> <a href="#--ftp-ssl-control">--ftp-ssl-control</a> <a href="#-G">-G, --get</a> <a href="#-g">-g, --globoff</a> <a href="#--happy-eyeballs-timeout-ms">--happy-eyeballs-timeout-ms</a> <a href="#--haproxy-clientip">--haproxy-clientip</a> <a href="#--haproxy-protocol">--haproxy-protocol</a> <a href="#-I">-I, --head</a> <a href="#-H">-H, --header</a> <a href="#-h">-h, --help</a> <a href="#--hostpubmd5">--hostpubmd5</a> <a href="#--hostpubsha256">--hostpubsha256</a> <a href="#--hsts">--hsts</a> <a href="#--http09">--http0.9</a> <a href="#-0">-0, --http1.0</a> <a href="#--http11">--http1.1</a> <a href="#--http2">--http2</a> <a href="#--http2-prior-knowledge">--http2-prior-knowledge</a> <a href="#--http3">--http3</a> <a href="#--http3-only">--http3-only</a> <a href="#--ignore-content-length">--ignore-content-length</a> <a href="#-i">-i, --include</a> <a href="#-k">-k, --insecure</a> <a href="#--interface">--interface</a> <a href="#--ipfs-gateway">--ipfs-gateway</a> <a href="#-4">-4, --ipv4</a> <a href="#-6">-6, --ipv6</a> <a href="#--json">--json</a> <a href="#-j">-j, --junk-session-cookies</a> <a href="#--keepalive-time">--keepalive-time</a> <a href="#--key">--key</a> <a href="#--key-type">--key-type</a> <a href="#--krb">--krb</a> <a href="#--libcurl">--libcurl</a> <a href="#--limit-rate">--limit-rate</a> <a href="#-l">-l, --list-only</a> <a href="#--local-port">--local-port</a> <a href="#-L">-L, --location</a> <a href="#--location-trusted">--location-trusted</a> <a href="#--login-options">--login-options</a> <a href="#--mail-auth">--mail-auth</a> <a href="#--mail-from">--mail-from</a> <a href="#--mail-rcpt">--mail-rcpt</a> <a href="#--mail-rcpt-allowfails">--mail-rcpt-allowfails</a> <a href="#-M">-M, --manual</a> <a href="#--max-filesize">--max-filesize</a> <a href="#--max-redirs">--max-redirs</a> <a href="#-m">-m, --max-time</a> <a href="#--metalink">--metalink</a> <a href="#--negotiate">--negotiate</a> <a href="#-n">-n, --netrc</a> <a href="#--netrc-file">--netrc-file</a> <a href="#--netrc-optional">--netrc-optional</a> <a href="#-:">-:, --next</a> <a href="#--no-alpn">--no-alpn</a> <a href="#-N">-N, --no-buffer</a> <a href="#--no-clobber">--no-clobber</a> <a href="#--no-keepalive">--no-keepalive</a> <a href="#--no-npn">--no-npn</a> <a href="#--no-progress-meter">--no-progress-meter</a> <a href="#--no-sessionid">--no-sessionid</a> <a href="#--noproxy">--noproxy</a> <a href="#--ntlm">--ntlm</a> <a href="#--ntlm-wb">--ntlm-wb</a> <a href="#--oauth2-bearer">--oauth2-bearer</a> <a href="#-o">-o, --output</a> <a href="#--output-dir">--output-dir</a> <a href="#-Z">-Z, --parallel</a> <a href="#--parallel-immediate">--parallel-immediate</a> <a href="#--parallel-max">--parallel-max</a> <a href="#--pass">--pass</a> <a href="#--path-as-is">--path-as-is</a> <a href="#--pinnedpubkey">--pinnedpubkey</a> <a href="#--post301">--post301</a> <a href="#--post302">--post302</a> <a href="#--post303">--post303</a> <a href="#--preproxy">--preproxy</a> <a href="#-#">-#, --progress-bar</a> <a href="#--proto">--proto</a> <a href="#--proto-default">--proto-default</a> <a href="#--proto-redir">--proto-redir</a> <a href="#-x">-x, --proxy</a> <a href="#--proxy-anyauth">--proxy-anyauth</a> <a href="#--proxy-basic">--proxy-basic</a> <a href="#--proxy-ca-native">--proxy-ca-native</a> <a href="#--proxy-cacert">--proxy-cacert</a> <a href="#--proxy-capath">--proxy-capath</a> <a href="#--proxy-cert">--proxy-cert</a> <a href="#--proxy-cert-type">--proxy-cert-type</a> <a href="#--proxy-ciphers">--proxy-ciphers</a> <a href="#--proxy-crlfile">--proxy-crlfile</a> <a href="#--proxy-digest">--proxy-digest</a> <a href="#--proxy-header">--proxy-header</a> <a href="#--proxy-http2">--proxy-http2</a> <a href="#--proxy-insecure">--proxy-insecure</a> <a href="#--proxy-key">--proxy-key</a> <a href="#--proxy-key-type">--proxy-key-type</a> <a href="#--proxy-negotiate">--proxy-negotiate</a> <a href="#--proxy-ntlm">--proxy-ntlm</a> <a href="#--proxy-pass">--proxy-pass</a> <a href="#--proxy-pinnedpubkey">--proxy-pinnedpubkey</a> <a href="#--proxy-service-name">--proxy-service-name</a> <a href="#--proxy-ssl-allow-beast">--proxy-ssl-allow-beast</a> <a href="#--proxy-ssl-auto-client-cert">--proxy-ssl-auto-client-cert</a> <a href="#--proxy-tls13-ciphers">--proxy-tls13-ciphers</a> <a href="#--proxy-tlsauthtype">--proxy-tlsauthtype</a> <a href="#--proxy-tlspassword">--proxy-tlspassword</a> <a href="#--proxy-tlsuser">--proxy-tlsuser</a> <a href="#--proxy-tlsv1">--proxy-tlsv1</a> <a href="#-U">-U, --proxy-user</a> <a href="#--proxy10">--proxy1.0</a> <a href="#-p">-p, --proxytunnel</a> <a href="#--pubkey">--pubkey</a> <a href="#-Q">-Q, --quote</a> <a href="#--random-file">--random-file</a> <a href="#-r">-r, --range</a> <a href="#--rate">--rate</a> <a href="#--raw">--raw</a> <a href="#-e">-e, --referer</a> <a href="#-J">-J, --remote-header-name</a> <a href="#-O">-O, --remote-name</a> <a href="#--remote-name-all">--remote-name-all</a> <a href="#-R">-R, --remote-time</a> <a href="#--remove-on-error">--remove-on-error</a> <a href="#-X">-X, --request</a> <a href="#--request-target">--request-target</a> <a href="#--resolve">--resolve</a> <a href="#--retry">--retry</a> <a href="#--retry-all-errors">--retry-all-errors</a> <a href="#--retry-connrefused">--retry-connrefused</a> <a href="#--retry-delay">--retry-delay</a> <a href="#--retry-max-time">--retry-max-time</a> <a href="#--sasl-authzid">--sasl-authzid</a> <a href="#--sasl-ir">--sasl-ir</a> <a href="#--service-name">--service-name</a> <a href="#-S">-S, --show-error</a> <a href="#-s">-s, --silent</a> <a href="#--socks4">--socks4</a> <a href="#--socks4a">--socks4a</a> <a href="#--socks5">--socks5</a> <a href="#--socks5-basic">--socks5-basic</a> <a href="#--socks5-gssapi">--socks5-gssapi</a> <a href="#--socks5-gssapi-nec">--socks5-gssapi-nec</a> <a href="#--socks5-gssapi-service">--socks5-gssapi-service</a> <a href="#--socks5-hostname">--socks5-hostname</a> <a href="#-Y">-Y, --speed-limit</a> <a href="#-y">-y, --speed-time</a> <a href="#--ssl">--ssl</a> <a href="#--ssl-allow-beast">--ssl-allow-beast</a> <a href="#--ssl-auto-client-cert">--ssl-auto-client-cert</a> <a href="#--ssl-no-revoke">--ssl-no-revoke</a> <a href="#--ssl-reqd">--ssl-reqd</a> <a href="#--ssl-revoke-best-effort">--ssl-revoke-best-effort</a> <a href="#-2">-2, --sslv2</a> <a href="#-3">-3, --sslv3</a> <a href="#--stderr">--stderr</a> <a href="#--styled-output">--styled-output</a> <a href="#--suppress-connect-headers">--suppress-connect-headers</a> <a href="#--tcp-fastopen">--tcp-fastopen</a> <a href="#--tcp-nodelay">--tcp-nodelay</a> <a href="#-t">-t, --telnet-option</a> <a href="#--tftp-blksize">--tftp-blksize</a> <a href="#--tftp-no-options">--tftp-no-options</a> <a href="#-z">-z, --time-cond</a> <a href="#--tls-max">--tls-max</a> <a href="#--tls13-ciphers">--tls13-ciphers</a> <a href="#--tlsauthtype">--tlsauthtype</a> <a href="#--tlspassword">--tlspassword</a> <a href="#--tlsuser">--tlsuser</a> <a href="#-1">-1, --tlsv1</a> <a href="#--tlsv10">--tlsv1.0</a> <a href="#--tlsv11">--tlsv1.1</a> <a href="#--tlsv12">--tlsv1.2</a> <a href="#--tlsv13">--tlsv1.3</a> <a href="#--tr-encoding">--tr-encoding</a> <a href="#--trace">--trace</a> <a href="#--trace-ascii">--trace-ascii</a> <a href="#--trace-config">--trace-config</a> <a href="#--trace-ids">--trace-ids</a> <a href="#--trace-time">--trace-time</a> <a href="#--unix-socket">--unix-socket</a> <a href="#-T">-T, --upload-file</a> <a href="#--url">--url</a> <a href="#--url-query">--url-query</a> <a href="#-B">-B, --use-ascii</a> <a href="#-u">-u, --user</a> <a href="#-A">-A, --user-agent</a> <a href="#--variable">--variable</a> <a href="#-v">-v, --verbose</a> <a href="#-V">-V, --version</a> <a href="#-w">-w, --write-out</a> <a href="#--xattr">--xattr</a> <!-- 258 options generated --> </div> </div> <div class="where"><a href="/">curl</a> / <a href="/docs/">Docs</a> / <a href="/docs/tooldocs.html">Tool</a> / <b>man page</b></div> <h1> curl man page </h1> <div class="relatedbox"> <b>Related:</b> <br><a href="faq.html">FAQ</a> <br><a href="https://github.com/curl/curl/issues/new?title=curl%20manpage:&labels=documentation&template=docs.yml" target="_new">File a bug about this man page</a> <br><a href="httpscripting.html">HTTP Scripting</a> <br><a href="tutorial.html">Tutorial</a> <br><a href="optionswhen.html">When options were added</a> </div> <!-- generated with roffit --> <a name="NAME"></a><h2 class="nroffsh">Name</h2> <p class="level0">curl - transfer a URL </p><a name="SYNOPSIS"></a><h2 class="nroffsh">Synopsis</h2> <p class="level0"><span Class="bold">curl [options / URLs]</span> </p><a name="DESCRIPTION"></a><h2 class="nroffsh">Description</h2> <p class="level0"><span Class="bold">curl</span> is a tool for transferring data from or to a server using URLs. It supports these protocols: DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET, TFTP, WS and WSS. </p> <p class="level0">curl is powered by libcurl for all transfer-related features. See <span Class="emphasis">libcurl(3)</span> for details. </p><a name="URL"></a><h2 class="nroffsh">Url</h2> <p class="level0">The URL syntax is protocol-dependent. You find a detailed description in <a href="https://www.ietf.org/rfc/rfc3986.txt">RFC 3986</a>. </p> <p class="level0">If you provide a URL without a leading <span Class="bold">protocol://</span> scheme, curl guesses what protocol you want. It then defaults to HTTP but assumes others based on often-used hostname prefixes. For example, for hostnames starting with "ftp." curl assumes you want FTP. </p> <p class="level0">You can specify any amount of URLs on the command line. They are fetched in a sequential manner in the specified order unless you use <a class="emphasis" href="#-Z">-Z, --parallel</a>. You can specify command line options and URLs mixed and in any order on the command line. </p> <p class="level0">curl attempts to reuse connections when doing multiple transfers, so that getting many files from the same server do not use multiple connects and setup handshakes. This improves speed. Connection reuse can only be done for URLs specified for a single command line invocation and cannot be performed between separate curl runs. </p> <p class="level0">Provide an IPv6 zone id in the URL with an escaped percentage sign. Like in </p><pre class="level0"> "http://[fe80::3%25eth0]/" </pre> <p class="level0">Everything provided on the command line that is not a command line option or its argument, curl assumes is a URL and treats it as such. </p><a name="GLOBBING"></a><h2 class="nroffsh">Globbing</h2> <p class="level0">You can specify multiple URLs or parts of URLs by writing lists within braces or ranges within brackets. We call this "globbing". </p> <p class="level0">Provide a list with three different names like this: </p><pre class="level0"> "http://site.{one,two,three}.com" </pre> <p class="level0">Do sequences of alphanumeric series by using [] as in: </p><pre class="level0"> "ftp://ftp.example.com/file[1-100].txt" </pre> <p class="level0">With leading zeroes: </p><pre class="level0"> "ftp://ftp.example.com/file[001-100].txt" </pre> <p class="level0">With letters through the alphabet: </p><pre class="level0"> "ftp://ftp.example.com/file[a-z].txt" </pre> <p class="level0">Nested sequences are not supported, but you can use several ones next to each other: </p><pre class="level0"> "http://example.com/archive[1996-1999]/vol[1-4]/part{a,b,c}.html" </pre> <p class="level0">You can specify a step counter for the ranges to get every Nth number or letter: </p><pre class="level0"> "http://example.com/file[1-100:10].txt" "http://example.com/file[a-z:2].txt" </pre> <p class="level0">When using [] or {} sequences when invoked from a command line prompt, you probably have to put the full URL within double quotes to avoid the shell from interfering with it. This also goes for other characters treated special, like for example '&', '?' and '*'. </p> <p class="level0">Switch off globbing with <a class="emphasis" href="#-g">-g, --globoff</a>. </p><a name="VARIABLES"></a><h2 class="nroffsh">Variables</h2> <p class="level0">curl supports command line variables (added in 8.3.0). Set variables with <a class="emphasis" href="#--variable">--variable</a> name=content or <a class="emphasis" href="#--variable">--variable</a> name@file (where "file" can be stdin if set to a single dash (-)). </p> <p class="level0">Variable contents can be expanded in option parameters using "{{name}}" if the option name is prefixed with "<span Class="emphasis">--expand-</span>". This gets the contents of the variable "name" inserted, or a blank if the name does not exist as a variable. Insert "{{" verbatim in the string by prefixing it with a backslash, like "\{{". </p> <p class="level0">You access and expand environment variables by first importing them. You select to either require the environment variable to be set or you can provide a default value in case it is not already set. Plain "<a class="emphasis" href="#--variable">--variable</a> %name" imports the variable called "name" but exits with an error if that environment variable is not already set. To provide a default value if it is not set, use "<a class="emphasis" href="#--variable">--variable</a> %name=content" or "<a class="emphasis" href="#--variable">--variable</a> %name@content". </p> <p class="level0">Example. Get the USER environment variable into the URL, fail if USER is not set: </p><pre class="level0"> --variable '%USER' --expand-url = "https://example.com/api/{{USER}}/method" </pre> <p class="level0">When expanding variables, curl supports a set of functions that can make the variable contents more convenient to use. It can trim leading and trailing white space with "trim", it can output the contents as a JSON quoted string with "json", URL encode the string with "url" or base64 encode it with "b64". To apply functions to a variable expansion, add them colon separated to the right side of the variable. Variable content holding null bytes that are not encoded when expanded cause error. </p> <p class="level0">Example: get the contents of a file called $HOME/.secret into a variable called "fix". Make sure that the content is trimmed and percent-encoded when sent as POST data: </p><pre class="level0"> --variable %HOME --expand-variable fix@{{HOME}}/.secret --expand-data "{{fix:trim:url}}" https://example.com/ </pre> <p class="level0">Command line variables and expansions were added in 8.3.0. </p><a name="OUTPUT"></a><h2 class="nroffsh">Output</h2> <p class="level0">If not told otherwise, curl writes the received data to stdout. It can be instructed to instead save that data into a local file, using the <a class="emphasis" href="#-o">-o, --output</a> or <a class="emphasis" href="#-O">-O, --remote-name</a> options. If curl is given multiple URLs to transfer on the command line, it similarly needs multiple options for where to save them. </p> <p class="level0">curl does not parse or otherwise "understand" the content it gets or writes as output. It does no encoding or decoding, unless explicitly asked to with dedicated command line options. </p><a name="PROTOCOLS"></a><h2 class="nroffsh">Protocols</h2> <p class="level0">curl supports numerous protocols, or put in URL terms: schemes. Your particular build may not support them all. </p> <p class="level0"><a name="DICT"></a><span class="nroffip">DICT</span> </p> <p class="level1">Lets you lookup words using online dictionaries. </p> <p class="level0"><a name="FILE"></a><span class="nroffip">FILE</span> </p> <p class="level1">Read or write local files. curl does not support accessing file:// URL remotely, but when running on Microsoft Windows using the native UNC approach works. </p> <p class="level0"><a name="FTPS"></a><span class="nroffip">FTP(S)</span> </p> <p class="level1">curl supports the File Transfer Protocol with a lot of tweaks and levers. With or without using TLS. </p> <p class="level0"><a name="GOPHERS"></a><span class="nroffip">GOPHER(S)</span> </p> <p class="level1">Retrieve files. </p> <p class="level0"><a name="HTTPS"></a><span class="nroffip">HTTP(S)</span> </p> <p class="level1">curl supports HTTP with numerous options and variations. It can speak HTTP version 0.9, 1.0, 1.1, 2 and 3 depending on build options and the correct command line options. </p> <p class="level0"><a name="IMAPS"></a><span class="nroffip">IMAP(S)</span> </p> <p class="level1">Using the mail reading protocol, curl can download emails for you. With or without using TLS. </p> <p class="level0"><a name="LDAPS"></a><span class="nroffip">LDAP(S)</span> </p> <p class="level1">curl can do directory lookups for you, with or without TLS. </p> <p class="level0"><a name="MQTT"></a><span class="nroffip">MQTT</span> </p> <p class="level1">curl supports MQTT version 3. Downloading over MQTT equals subscribe to a topic while uploading/posting equals publish on a topic. MQTT over TLS is not supported (yet). </p> <p class="level0"><a name="POP3S"></a><span class="nroffip">POP3(S)</span> </p> <p class="level1">Downloading from a pop3 server means getting a mail. With or without using TLS. </p> <p class="level0"><a name="RTMPS"></a><span class="nroffip">RTMP(S)</span> </p> <p class="level1">The <span Class="bold">Realtime Messaging Protocol</span> is primarily used to serve streaming media and curl can download it. </p> <p class="level0"><a name="RTSP"></a><span class="nroffip">RTSP</span> </p> <p class="level1">curl supports RTSP 1.0 downloads. </p> <p class="level0"><a name="SCP"></a><span class="nroffip">SCP</span> </p> <p class="level1">curl supports SSH version 2 scp transfers. </p> <p class="level0"><a name="SFTP"></a><span class="nroffip">SFTP</span> </p> <p class="level1">curl supports SFTP (draft 5) done over SSH version 2. </p> <p class="level0"><a name="SMBS"></a><span class="nroffip">SMB(S)</span> </p> <p class="level1">curl supports SMB version 1 for upload and download. </p> <p class="level0"><a name="SMTPS"></a><span class="nroffip">SMTP(S)</span> </p> <p class="level1">Uploading contents to an SMTP server means sending an email. With or without TLS. </p> <p class="level0"><a name="TELNET"></a><span class="nroffip">TELNET</span> </p> <p class="level1">Fetching a telnet URL starts an interactive session where it sends what it reads on stdin and outputs what the server sends it. </p> <p class="level0"><a name="TFTP"></a><span class="nroffip">TFTP</span> </p> <p class="level1">curl can do TFTP downloads and uploads. </p> <p class="level0"><a name="WSS"></a><span class="nroffip">WS(S)</span> </p> <p class="level1">WebSocket done over HTTP/1. WSS implies that it works over HTTPS. </p><a name="PROGRESS"></a><h2 class="nroffsh">Progress meter</h2> <p class="level0">curl normally displays a progress meter during operations, indicating the amount of transferred data, transfer speeds and estimated time left, etc. The progress meter displays the transfer rate in bytes per second. The suffixes (k, M, G, T, P) are 1024 based. For example 1k is 1024 bytes. 1M is 1048576 bytes. </p> <p class="level0">curl displays this data to the terminal by default, so if you invoke curl to do an operation and it is about to write data to the terminal, it <span Class="emphasis">disables</span> the progress meter as otherwise it would mess up the output mixing progress meter and response data. </p> <p class="level0">If you want a progress meter for HTTP POST or PUT requests, you need to redirect the response output to a file, using shell redirect (>), <a class="emphasis" href="#-o">-o, --output</a> or similar. </p> <p class="level0">This does not apply to FTP upload as that operation does not spit out any response data to the terminal. </p> <p class="level0">If you prefer a progress bar instead of the regular meter, <span Class="emphasis">-#, --progress-bar</span> is your friend. You can also disable the progress meter completely with the <a class="emphasis" href="#-s">-s, --silent</a> option. </p><a name="VERSION"></a><h2 class="nroffsh">Version</h2> <p class="level0">This man page describes curl 8.11.1. If you use a later version, chances are this man page does not fully document it. If you use an earlier version, this document tries to include version information about which specific version that introduced changes. </p> <p class="level0">You can always learn which the latest curl version is by running </p><pre class="level0"> curl https://curl.se/info </pre> <p class="level0">The online version of this man page is always showing the latest incarnation: <a href="https://curl.se/docs/manpage.html">https://curl.se/docs/manpage.html</a> </p><a name="OPTIONS"></a><h2 class="nroffsh">Options</h2> <p class="level0">Options start with one or two dashes. Many of the options require an additional value next to them. If provided text does not start with a dash, it is presumed to be and treated as a URL. </p> <p class="level0">The short "single-dash" form of the options, -d for example, may be used with or without a space between it and its value, although a space is a recommended separator. The long double-dash form, <a class="emphasis" href="#-d">-d, --data</a> for example, requires a space between it and its value. </p> <p class="level0">Short version options that do not need any additional values can be used immediately next to each other, like for example you can specify all the options <a class="emphasis" href="#-O">-O</a>, <a class="emphasis" href="#-L">-L</a> and <a class="emphasis" href="#-v">-v</a> at once as <span Class="emphasis">-OLv</span>. </p> <p class="level0">In general, all boolean options are enabled with --<span Class="bold">option</span> and yet again disabled with --<span Class="bold">no-</span>option. That is, you use the same option name but prefix it with "no-". However, in this list we mostly only list and show the --<span Class="bold">option</span> version of them. </p> <p class="level0">When <a class="emphasis" href="#-">-:, --next</a> is used, it resets the parser state and you start again with a clean option state, except for the options that are global. Global options retain their values and meaning even after <a class="emphasis" href="#-">-:, --next</a>. </p> <p class="level0">The following options are global: <a class="emphasis" href="#--fail-early">--fail-early</a>, <a class="emphasis" href="#--libcurl">--libcurl</a>, <a class="emphasis" href="#--parallel-immediate">--parallel-immediate</a>, <a class="emphasis" href="#--parallel-max">--parallel-max</a>, <a class="emphasis" href="#-Z">-Z, --parallel</a>, <span Class="emphasis">-#, --progress-bar</span>, <a class="emphasis" href="#--rate">--rate</a>, <a class="emphasis" href="#-S">-S, --show-error</a>, <a class="emphasis" href="#--stderr">--stderr</a>, <a class="emphasis" href="#--styled-output">--styled-output</a>, <a class="emphasis" href="#--trace-ascii">--trace-ascii</a>, <a class="emphasis" href="#--trace-config">--trace-config</a>, <a class="emphasis" href="#--trace-ids">--trace-ids</a>, <a class="emphasis" href="#--trace-time">--trace-time</a>, <a class="emphasis" href="#--trace">--trace</a> and <a class="emphasis" href="#-v">-v, --verbose</a>. </p><a name="ALL"></a><h2 class="nroffsh">All options</h2> <p class="level0"><a name="--abstract-unix-socket"></a><span class="nroffip">--abstract-unix-socket <path></span> </p> <p class="level1">(HTTP) Connect through an abstract Unix domain socket, instead of using the network. Note: netstat shows the path of an abstract socket prefixed with "@", however the <path> argument should not have this leading character. </p> <p class="level1">If --abstract-unix-socket is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --abstract-unix-socket socketpath https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--unix-socket">--unix-socket</a>. </p> <p class="level0"><a name="--alt-svc"></a><span class="nroffip">--alt-svc <filename></span> </p> <p class="level1">(HTTPS) Enable the alt-svc parser. If the filename points to an existing alt-svc cache file, that gets used. After a completed transfer, the cache is saved to the filename again if it has been modified. </p> <p class="level1">Specify a "" filename (zero length) to avoid loading/saving and make curl just handle the cache in memory. </p> <p class="level1">If this option is used several times, curl loads contents from all the files but the last one is used for saving. </p> <p class="level1">--alt-svc can be used several times in a command line </p> <p class="level1">Example: </p><pre class="level1"> curl --alt-svc svc.txt https://example.com </pre> <p class="level1">Added in 7.64.1. See also <a class="emphasis" href="#--resolve">--resolve</a> and <a class="emphasis" href="#--connect-to">--connect-to</a>. </p> <p class="level0"><a name="--anyauth"></a><span class="nroffip">--anyauth</span> </p> <p class="level1">(HTTP) Figure out authentication method automatically, and use the most secure one the remote site claims to support. This is done by first doing a request and checking the response-headers, thus possibly inducing an extra network round-trip. This option is used instead of setting a specific authentication method, which you can do with <a class="emphasis" href="#--basic">--basic</a>, <a class="emphasis" href="#--digest">--digest</a>, <a class="emphasis" href="#--ntlm">--ntlm</a>, and <a class="emphasis" href="#--negotiate">--negotiate</a>. </p> <p class="level1">Using <a class="emphasis" href="#--anyauth">--anyauth</a> is not recommended if you do uploads from stdin, since it may require data to be sent twice and then the client must be able to rewind. If the need should arise when uploading from stdin, the upload operation fails. </p> <p class="level1">Used together with <a class="emphasis" href="#-u">-u, --user</a>. </p> <p class="level1">Providing --anyauth multiple times has no extra effect. </p> <p class="level1">Example: </p><pre class="level1"> curl --anyauth --user me:pwd https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--proxy-anyauth">--proxy-anyauth</a>, <a class="emphasis" href="#--basic">--basic</a> and <a class="emphasis" href="#--digest">--digest</a>. </p> <p class="level0"><a name="-a"></a><span class="nroffip">-a, --append</span> </p> <p class="level1">(FTP SFTP) When used in an upload, this option makes curl append to the target file instead of overwriting it. If the remote file does not exist, it is created. Note that this flag is ignored by some SFTP servers (including OpenSSH). </p> <p class="level1">Providing --append multiple times has no extra effect. Disable it again with --no-append. </p> <p class="level1">Example: </p><pre class="level1"> curl --upload-file local --append ftp://example.com/ </pre> <p class="level1">See also <a class="emphasis" href="#-r">-r, --range</a> and <a class="emphasis" href="#-C">-C, --continue-at</a>. </p> <p class="level0"><a name="--aws-sigv4"></a><span class="nroffip">--aws-sigv4 <provider1[:prvdr2[:reg[:srv]]]></span> </p> <p class="level1">(HTTP) Use AWS V4 signature authentication in the transfer. </p> <p class="level1">The provider argument is a string that is used by the algorithm when creating outgoing authentication headers. </p> <p class="level1">The region argument is a string that points to a geographic area of a resources collection (region-code) when the region name is omitted from the endpoint. </p> <p class="level1">The service argument is a string that points to a function provided by a cloud (service-code) when the service name is omitted from the endpoint. </p> <p class="level1">If --aws-sigv4 is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --aws-sigv4 "aws:amz:us-east-2:es" --user "key:secret" https://example.com </pre> <p class="level1">Added in 7.75.0. See also <a class="emphasis" href="#--basic">--basic</a> and <a class="emphasis" href="#-u">-u, --user</a>. </p> <p class="level0"><a name="--basic"></a><span class="nroffip">--basic</span> </p> <p class="level1">(HTTP) Use HTTP Basic authentication with the remote host. This method is the default and this option is usually pointless, unless you use it to override a previously set option that sets a different authentication method (such as <a class="emphasis" href="#--ntlm">--ntlm</a>, <a class="emphasis" href="#--digest">--digest</a>, or <a class="emphasis" href="#--negotiate">--negotiate</a>). </p> <p class="level1">Used together with <a class="emphasis" href="#-u">-u, --user</a>. </p> <p class="level1">Providing --basic multiple times has no extra effect. </p> <p class="level1">Example: </p><pre class="level1"> curl -u name:password --basic https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--proxy-basic">--proxy-basic</a>. </p> <p class="level0"><a name="--ca-native"></a><span class="nroffip">--ca-native</span> </p> <p class="level1">(TLS) Use the CA store from the native operating system to verify the peer. By default, curl otherwise uses a CA store provided in a single file or directory, but when using this option it interfaces the operating system's own vault. </p> <p class="level1">This option works for curl on Windows when built to use OpenSSL, wolfSSL (added in 8.3.0) or GnuTLS (added in 8.5.0). When curl on Windows is built to use Schannel, this feature is implied and curl then only uses the native CA store. </p> <p class="level1">Providing --ca-native multiple times has no extra effect. Disable it again with --no-ca-native. </p> <p class="level1">Example: </p><pre class="level1"> curl --ca-native https://example.com </pre> <p class="level1">Added in 8.2.0. See also <a class="emphasis" href="#--cacert">--cacert</a>, <a class="emphasis" href="#--capath">--capath</a>, <a class="emphasis" href="#--dump-ca-embed">--dump-ca-embed</a> and <a class="emphasis" href="#-k">-k, --insecure</a>. </p> <p class="level0"><a name="--cacert"></a><span class="nroffip">--cacert <file></span> </p> <p class="level1">(TLS) Use the specified certificate file to verify the peer. The file may contain multiple CA certificates. The certificate(s) must be in PEM format. Normally curl is built to use a default file for this, so this option is typically used to alter that default file. </p> <p class="level1">curl recognizes the environment variable named 'CURL_CA_BUNDLE' if it is set and the TLS backend is not Schannel, and uses the given path as a path to a CA cert bundle. This option overrides that variable. </p> <p class="level1">(Windows) curl automatically looks for a CA certs file named 'curl-ca-bundle.crt', either in the same directory as curl.exe, or in the Current Working Directory, or in any folder along your PATH. </p> <p class="level1">curl 8.11.0 added a build-time option to disable this search behavior, and another option to restrict search to the application's directory. </p> <p class="level1">(iOS and macOS only) If curl is built against Secure Transport, then this option is supported for backward compatibility with other SSL engines, but it should not be set. If the option is not set, then curl uses the certificates in the system and user Keychain to verify the peer, which is the preferred method of verifying the peer's certificate chain. </p> <p class="level1">(Schannel only) This option is supported for Schannel in Windows 7 or later (added in 7.60.0). This option is supported for backward compatibility with other SSL engines; instead it is recommended to use Windows' store of root certificates (the default for Schannel). </p> <p class="level1">If --cacert is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --cacert CA-file.txt https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--capath">--capath</a>, <a class="emphasis" href="#--dump-ca-embed">--dump-ca-embed</a> and <a class="emphasis" href="#-k">-k, --insecure</a>. </p> <p class="level0"><a name="--capath"></a><span class="nroffip">--capath <dir></span> </p> <p class="level1">(TLS) Use the specified certificate directory to verify the peer. Multiple paths can be provided by separated with colon (":") (e.g. "path1:path2:path3"). The certificates must be in PEM format, and if curl is built against OpenSSL, the directory must have been processed using the c_rehash utility supplied with OpenSSL. Using <a class="emphasis" href="#--capath">--capath</a> can allow OpenSSL-powered curl to make SSL-connections much more efficiently than using <a class="emphasis" href="#--cacert">--cacert</a> if the <a class="emphasis" href="#--cacert">--cacert</a> file contains many CA certificates. </p> <p class="level1">If this option is set, the default capath value is ignored. </p> <p class="level1">If --capath is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --capath /local/directory https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--cacert">--cacert</a>, <a class="emphasis" href="#--dump-ca-embed">--dump-ca-embed</a> and <a class="emphasis" href="#-k">-k, --insecure</a>. </p> <p class="level0"><a name="-E"></a><span class="nroffip">-E, --cert <certificate[:password]></span> </p> <p class="level1">(TLS) Use the specified client certificate file when getting a file with HTTPS, FTPS or another SSL-based protocol. The certificate must be in PKCS#12 format if using Secure Transport, or PEM format if using any other engine. If the optional password is not specified, it is queried for on the terminal. Note that this option assumes a certificate file that is the private key and the client certificate concatenated. See <a class="emphasis" href="#-E">-E, --cert</a> and <a class="emphasis" href="#--key">--key</a> to specify them independently. </p> <p class="level1">In the <certificate> portion of the argument, you must escape the character ":" as "\:" so that it is not recognized as the password delimiter. Similarly, you must escape the double quote character as \" so that it is not recognized as an escape character. </p> <p class="level1">If curl is built against OpenSSL library, and the engine pkcs11 is available, then a PKCS#11 URI (<a href="https://www.ietf.org/rfc/rfc7512.txt">RFC 7512</a>) can be used to specify a certificate located in a PKCS#11 device. A string beginning with "pkcs11:" is interpreted as a PKCS#11 URI. If a PKCS#11 URI is provided, then the <a class="emphasis" href="#--engine">--engine</a> option is set as "pkcs11" if none was provided and the <a class="emphasis" href="#--cert-type">--cert-type</a> option is set as "ENG" if none was provided. </p> <p class="level1">If curl is built against GnuTLS library, a PKCS#11 URI can be used to specify a certificate located in a PKCS#11 device. A string beginning with "pkcs11:" is interpreted as a PKCS#11 URI. </p> <p class="level1">(iOS and macOS only) If curl is built against Secure Transport, then the certificate string can either be the name of a certificate/private key in the system or user keychain, or the path to a PKCS#12-encoded certificate and private key. If you want to use a file from the current directory, please precede it with "./" prefix, in order to avoid confusion with a nickname. </p> <p class="level1">(Schannel only) Client certificates must be specified by a path expression to a certificate store. (Loading <span Class="emphasis">PFX</span> is not supported; you can import it to a store first). You can use "<store location>\<store name>\<thumbprint>" to refer to a certificate in the system certificates store, for example, <span Class="emphasis">"CurrentUser\MY\934a7ac6f8a5d579285a74fa61e19f23ddfe8d7a"</span>. Thumbprint is usually a SHA-1 hex string which you can see in certificate details. Following store locations are supported: <span Class="emphasis">CurrentUser</span>, <span Class="emphasis">LocalMachine</span>, <span Class="emphasis">CurrentService</span>, <span Class="emphasis">Services</span>, <span Class="emphasis">CurrentUserGroupPolicy</span>, <span Class="emphasis">LocalMachineGroupPolicy</span> and <span Class="emphasis">LocalMachineEnterprise</span>. </p> <p class="level1">If --cert is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --cert certfile --key keyfile https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--cert-type">--cert-type</a>, <a class="emphasis" href="#--key">--key</a> and <a class="emphasis" href="#--key-type">--key-type</a>. </p> <p class="level0"><a name="--cert-status"></a><span class="nroffip">--cert-status</span> </p> <p class="level1">(TLS) Verify the status of the server certificate by using the Certificate Status Request (aka. OCSP stapling) TLS extension. </p> <p class="level1">If this option is enabled and the server sends an invalid (e.g. expired) response, if the response suggests that the server certificate has been revoked, or no response at all is received, the verification fails. </p> <p class="level1">This support is currently only implemented in the OpenSSL and GnuTLS backends. </p> <p class="level1">Providing --cert-status multiple times has no extra effect. Disable it again with --no-cert-status. </p> <p class="level1">Example: </p><pre class="level1"> curl --cert-status https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--pinnedpubkey">--pinnedpubkey</a>. </p> <p class="level0"><a name="--cert-type"></a><span class="nroffip">--cert-type <type></span> </p> <p class="level1">(TLS) Set type of the provided client certificate. PEM, DER, ENG and P12 are recognized types. </p> <p class="level1">The default type depends on the TLS backend and is usually PEM, however for Secure Transport and Schannel it is P12. If <a class="emphasis" href="#-E">-E, --cert</a> is a pkcs11: URI then ENG is the default type. </p> <p class="level1">If --cert-type is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --cert-type PEM --cert file https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-E">-E, --cert</a>, <a class="emphasis" href="#--key">--key</a> and <a class="emphasis" href="#--key-type">--key-type</a>. </p> <p class="level0"><a name="--ciphers"></a><span class="nroffip">--ciphers <list></span> </p> <p class="level1">(TLS) Specifies which cipher suites to use in the connection if it negotiates TLS 1.2 (1.1, 1.0). The list of ciphers suites must specify valid ciphers. Read up on cipher suite details on this URL: </p> <p class="level1"><a href="https://curl.se/docs/ssl-ciphers.html">https://curl.se/docs/ssl-ciphers.html</a> </p> <p class="level1">If --ciphers is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256 https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--tls13-ciphers">--tls13-ciphers</a>, <a class="emphasis" href="#--proxy-ciphers">--proxy-ciphers</a> and <a class="emphasis" href="#--curves">--curves</a>. </p> <p class="level0"><a name="--compressed"></a><span class="nroffip">--compressed</span> </p> <p class="level1">(HTTP) Request a compressed response using one of the algorithms curl supports, and automatically decompress the content. </p> <p class="level1">Response headers are not modified when saved, so if they are "interpreted" separately again at a later point they might appear to be saying that the content is (still) compressed; while in fact it has already been decompressed. </p> <p class="level1">If this option is used and the server sends an unsupported encoding, curl reports an error. This is a request, not an order; the server may or may not deliver data compressed. </p> <p class="level1">Providing --compressed multiple times has no extra effect. Disable it again with --no-compressed. </p> <p class="level1">Example: </p><pre class="level1"> curl --compressed https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--compressed-ssh">--compressed-ssh</a>. </p> <p class="level0"><a name="--compressed-ssh"></a><span class="nroffip">--compressed-ssh</span> </p> <p class="level1">(SCP SFTP) Enables built-in SSH compression. This is a request, not an order; the server may or may not do it. </p> <p class="level1">Providing --compressed-ssh multiple times has no extra effect. Disable it again with --no-compressed-ssh. </p> <p class="level1">Example: </p><pre class="level1"> curl --compressed-ssh sftp://example.com/ </pre> <p class="level1">See also <a class="emphasis" href="#--compressed">--compressed</a>. </p> <p class="level0"><a name="-K"></a><span class="nroffip">-K, --config <file></span> </p> <p class="level1">Specify a text file to read curl arguments from. The command line arguments found in the text file are used as if they were provided on the command line. </p> <p class="level1">Options and their parameters must be specified on the same line in the file, separated by whitespace, colon, or the equals sign. Long option names can optionally be given in the config file without the initial double dashes and if so, the colon or equals characters can be used as separators. If the option is specified with one or two dashes, there can be no colon or equals character between the option and its parameter. </p> <p class="level1">If the parameter contains whitespace or starts with a colon (:) or equals sign (=), it must be specified enclosed within double quotes ("like this"). Within double quotes the following escape sequences are available: \ \", \t, \n, \r and \v. A backslash preceding any other letter is ignored. </p> <p class="level1">If the first non-blank column of a config line is a '#' character, that line is treated as a comment. </p> <p class="level1">Only write one option per physical line in the config file. A single line is required to be no more than 10 megabytes (since 8.2.0). </p> <p class="level1">Specify the filename to <a class="emphasis" href="#-K">-K, --config</a> as minus "-" to make curl read the file from stdin. </p> <p class="level1">Note that to be able to specify a URL in the config file, you need to specify it using the <a class="emphasis" href="#--url">--url</a> option, and not by simply writing the URL on its own line. So, it could look similar to this: </p><pre class="level1"> url = "https://curl.se/docs/" # --- Example file --- # this is a comment url = "example.com" output = "curlhere.html" user-agent = "superagent/1.0" # and fetch another URL too url = "example.com/docs/manpage.html" -O referer = "http://nowhereatall.example.com/" # --- End of example file --- </pre> <p class="level1">When curl is invoked, it (unless <a class="emphasis" href="#-q">-q, --disable</a> is used) checks for a default config file and uses it if found, even when <a class="emphasis" href="#-K">-K, --config</a> is used. The default config file is checked for in the following places in this order: </p> <p class="level1">1) <span Class="bold">"$CURL_HOME/.curlrc"</span> </p> <p class="level1">2) <span Class="bold">"$XDG_CONFIG_HOME/curlrc"</span> (Added in 7.73.0) </p> <p class="level1">3) <span Class="bold">"$HOME/.curlrc"</span> </p> <p class="level1">4) Windows: <span Class="bold">"%USERPROFILE%\.curlrc"</span> </p> <p class="level1">5) Windows: <span Class="bold">"%APPDATA%\.curlrc"</span> </p> <p class="level1">6) Windows: <span Class="bold">"%USERPROFILE%\Application Data\.curlrc"</span> </p> <p class="level1">7) Non-Windows: use getpwuid to find the home directory </p> <p class="level1">8) On Windows, if it finds no <span Class="emphasis">.curlrc</span> file in the sequence described above, it checks for one in the same directory the curl executable is placed. </p> <p class="level1">On Windows two filenames are checked per location: <span Class="emphasis">.curlrc</span> and <span Class="emphasis">_curlrc</span>, preferring the former. Older versions on Windows checked for <span Class="emphasis">_curlrc</span> only. </p> <p class="level1">--config can be used several times in a command line </p> <p class="level1">Example: </p><pre class="level1"> curl --config file.txt https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-q">-q, --disable</a>. </p> <p class="level0"><a name="--connect-timeout"></a><span class="nroffip">--connect-timeout <seconds></span> </p> <p class="level1">Maximum time in seconds that you allow curl's connection to take. This only limits the connection phase, so if curl connects within the given period it continues - if not it exits. </p> <p class="level1">This option accepts decimal values. The decimal value needs to be provided using a dot (.) as decimal separator - not the local version even if it might be using another separator. </p> <p class="level1">The connection phase is considered complete when the DNS lookup and requested TCP, TLS or QUIC handshakes are done. </p> <p class="level1">If --connect-timeout is provided several times, the last set value is used. </p> <p class="level1">Examples: </p><pre class="level1"> curl --connect-timeout 20 https://example.com curl --connect-timeout 3.14 https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-m">-m, --max-time</a>. </p> <p class="level0"><a name="--connect-to"></a><span class="nroffip">--connect-to <HOST1:PORT1:HOST2:PORT2></span> </p> <p class="level1">For a request intended for the "HOST1:PORT1" pair, connect to "HOST2:PORT2" instead. This option is only used to establish the network connection. It does NOT affect the hostname/port number that is used for TLS/SSL (e.g. SNI, certificate verification) or for the application protocols. </p> <p class="level1">"HOST1" and "PORT1" may be empty strings, meaning any host or any port number. "HOST2" and "PORT2" may also be empty strings, meaning use the request's original hostname and port number. </p> <p class="level1">A hostname specified to this option is compared as a string, so it needs to match the name used in request URL. It can be either numerical such as "127.0.0.1" or the full host name such as "example.org". </p> <p class="level1">Example: redirect connects from the example.com hostname to 127.0.0.1 independently of port number: </p><pre class="level1"> curl --connect-to example.com::127.0.0.1: https://example.com/ </pre> <p class="level1">Example: redirect connects from all hostnames to 127.0.0.1 independently of port number: </p><pre class="level1"> curl --connect-to ::127.0.0.1: http://example.com/ </pre> <p class="level1">--connect-to can be used several times in a command line </p> <p class="level1">Example: </p><pre class="level1"> curl --connect-to example.com:443:example.net:8443 https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--resolve">--resolve</a> and <a class="emphasis" href="#-H">-H, --header</a>. </p> <p class="level0"><a name="-C"></a><span class="nroffip">-C, --continue-at <offset></span> </p> <p class="level1">Resume a previous transfer from the given byte offset. The given offset is the exact number of bytes that are skipped, counting from the beginning of the source file before it is transferred to the destination. If used with uploads, the FTP server command SIZE is not used by curl. </p> <p class="level1">Use "-C -" to instruct curl to automatically find out where/how to resume the transfer. It then uses the given output/input files to figure that out. </p> <p class="level1">If --continue-at is provided several times, the last set value is used. </p> <p class="level1">Examples: </p><pre class="level1"> curl -C - https://example.com curl -C 400 https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-r">-r, --range</a>. </p> <p class="level0"><a name="-b"></a><span class="nroffip">-b, --cookie <data|filename></span> </p> <p class="level1">(HTTP) This option has two slightly separate cookie sending functions. </p> <p class="level1">Either: pass the exact data to send to the HTTP server in the Cookie header. It is supposedly data previously received from the server in a "Set-Cookie:" line. The data should be in the format "NAME1=VALUE1; NAME2=VALUE2". When given a set of specific cookies, curl populates its cookie header with this content explicitly in all outgoing request(s). If multiple requests are done due to authentication, followed redirects or similar, they all get this cookie header passed on. </p> <p class="level1">Or: If no "=" symbol is used in the argument, it is instead treated as a filename to read previously stored cookie from. This option also activates the cookie engine which makes curl record incoming cookies, which may be handy if you are using this in combination with the <a class="emphasis" href="#-L">-L, --location</a> option or do multiple URL transfers on the same invoke. </p> <p class="level1">If the filename is a single minus ("-"), curl reads the contents from stdin. If the filename is an empty string ("") and is the only cookie input, curl activates the cookie engine without any cookies. </p> <p class="level1">The file format of the file to read cookies from should be plain HTTP headers (Set-Cookie style) or the Netscape/Mozilla cookie file format. </p> <p class="level1">The file specified with <a class="emphasis" href="#-b">-b, --cookie</a> is only used as input. No cookies are written to that file. To store cookies, use the <a class="emphasis" href="#-c">-c, --cookie-jar</a> option. </p> <p class="level1">If you use the Set-Cookie file format and do not specify a domain then the cookie is not sent since the domain never matches. To address this, set a domain in Set-Cookie line (doing that includes subdomains) or preferably: use the Netscape format. </p> <p class="level1">Users often want to both read cookies from a file and write updated cookies back to a file, so using both <a class="emphasis" href="#-b">-b, --cookie</a> and <a class="emphasis" href="#-c">-c, --cookie-jar</a> in the same command line is common. </p> <p class="level1">If curl is built with PSL (<span Class="bold">Public Suffix List</span>) support, it detects and discards cookies that are specified for such suffix domains that should not be allowed to have cookies. If curl is <span Class="emphasis">not</span> built with PSL support, it has no ability to stop super cookies. </p> <p class="level1">--cookie can be used several times in a command line </p> <p class="level1">Examples: </p><pre class="level1"> curl -b "" https://example.com curl -b cookiefile https://example.com curl -b cookiefile -c cookiefile https://example.com curl -b name=Jane https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-c">-c, --cookie-jar</a> and <a class="emphasis" href="#-j">-j, --junk-session-cookies</a>. </p> <p class="level0"><a name="-c"></a><span class="nroffip">-c, --cookie-jar <filename></span> </p> <p class="level1">(HTTP) Specify to which file you want curl to write all cookies after a completed operation. Curl writes all cookies from its in-memory cookie storage to the given file at the end of operations. Even if no cookies are known, a file is created so that it removes any formerly existing cookies from the file. The file uses the Netscape cookie file format. If you set the filename to a single minus, "-", the cookies are written to stdout. </p> <p class="level1">The file specified with <a class="emphasis" href="#-c">-c, --cookie-jar</a> is only used for output. No cookies are read from the file. To read cookies, use the <a class="emphasis" href="#-b">-b, --cookie</a> option. Both options can specify the same file. </p> <p class="level1">This command line option activates the cookie engine that makes curl record and use cookies. The <a class="emphasis" href="#-b">-b, --cookie</a> option also activates it. </p> <p class="level1">If the cookie jar cannot be created or written to, the whole curl operation does not fail or even report an error clearly. Using <a class="emphasis" href="#-v">-v, --verbose</a> gets a warning displayed, but that is the only visible feedback you get about this possibly lethal situation. </p> <p class="level1">If --cookie-jar is provided several times, the last set value is used. </p> <p class="level1">Examples: </p><pre class="level1"> curl -c store-here.txt https://example.com curl -c store-here.txt -b read-these https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-b">-b, --cookie</a> and <a class="emphasis" href="#-j">-j, --junk-session-cookies</a>. </p> <p class="level0"><a name="--create-dirs"></a><span class="nroffip">--create-dirs</span> </p> <p class="level1">When used in conjunction with the <a class="emphasis" href="#-o">-o, --output</a> option, curl creates the necessary local directory hierarchy as needed. This option creates the directories mentioned with the <a class="emphasis" href="#-o">-o, --output</a> option combined with the path possibly set with <a class="emphasis" href="#--output-dir">--output-dir</a>. If the combined output filename uses no directory, or if the directories it mentions already exist, no directories are created. </p> <p class="level1">Created directories are made with mode 0750 on Unix-style file systems. </p> <p class="level1">To create remote directories when using FTP or SFTP, try <a class="emphasis" href="#--ftp-create-dirs">--ftp-create-dirs</a>. </p> <p class="level1">Providing --create-dirs multiple times has no extra effect. Disable it again with --no-create-dirs. </p> <p class="level1">Example: </p><pre class="level1"> curl --create-dirs --output local/dir/file https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--ftp-create-dirs">--ftp-create-dirs</a> and <a class="emphasis" href="#--output-dir">--output-dir</a>. </p> <p class="level0"><a name="--create-file-mode"></a><span class="nroffip">--create-file-mode <mode></span> </p> <p class="level1">(SFTP SCP FILE) When curl is used to create files remotely using one of the supported protocols, this option allows the user to set which 'mode' to set on the file at creation time, instead of the default 0644. </p> <p class="level1">This option takes an octal number as argument. </p> <p class="level1">If --create-file-mode is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --create-file-mode 0777 -T localfile sftp://example.com/new </pre> <p class="level1">Added in 7.75.0. See also <a class="emphasis" href="#--ftp-create-dirs">--ftp-create-dirs</a>. </p> <p class="level0"><a name="--crlf"></a><span class="nroffip">--crlf</span> </p> <p class="level1">(FTP SMTP) Convert line feeds to carriage return plus line feeds in upload. Useful for <span Class="bold">MVS (OS/390)</span>. </p> <p class="level1">Providing --crlf multiple times has no extra effect. Disable it again with --no-crlf. </p> <p class="level1">Example: </p><pre class="level1"> curl --crlf -T file ftp://example.com/ </pre> <p class="level1">See also <a class="emphasis" href="#-B">-B, --use-ascii</a>. </p> <p class="level0"><a name="--crlfile"></a><span class="nroffip">--crlfile <file></span> </p> <p class="level1">(TLS) Provide a file using PEM format with a Certificate Revocation List that may specify peer certificates that are to be considered revoked. </p> <p class="level1">If --crlfile is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --crlfile rejects.txt https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--cacert">--cacert</a> and <a class="emphasis" href="#--capath">--capath</a>. </p> <p class="level0"><a name="--curves"></a><span class="nroffip">--curves <list></span> </p> <p class="level1">(TLS) Set specific curves to use during SSL session establishment according to RFC 8422, 5.1. Multiple algorithms can be provided by separating them with ":" (e.g. "X25519:P-521"). The parameter is available identically in the OpenSSL "s_client" and "s_server" utilities. </p> <p class="level1"><a class="emphasis" href="#--curves">--curves</a> allows a OpenSSL powered curl to make SSL-connections with exactly the (EC) curve requested by the client, avoiding nontransparent client/server negotiations. </p> <p class="level1">If this option is set, the default curves list built into OpenSSL are ignored. </p> <p class="level1">If --curves is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --curves X25519 https://example.com </pre> <p class="level1">Added in 7.73.0. See also <a class="emphasis" href="#--ciphers">--ciphers</a>. </p> <p class="level0"><a name="-d"></a><span class="nroffip">-d, --data <data></span> </p> <p class="level1">(HTTP MQTT) Sends the specified data in a POST request to the HTTP server, in the same way that a browser does when a user has filled in an HTML form and presses the submit button. This option makes curl pass the data to the server using the content-type application/x-www-form-urlencoded. Compare to <a class="emphasis" href="#-F">-F, --form</a>. </p> <p class="level1"><a class="emphasis" href="#--data-raw">--data-raw</a> is almost the same but does not have a special interpretation of the @ character. To post data purely binary, you should instead use the <a class="emphasis" href="#--data-binary">--data-binary</a> option. To URL-encode the value of a form field you may use <a class="emphasis" href="#--data-urlencode">--data-urlencode</a>. </p> <p class="level1">If any of these options is used more than once on the same command line, the data pieces specified are merged with a separating &-symbol. Thus, using '-d name=daniel -d skill=lousy' would generate a post chunk that looks like 'name=daniel&skill=lousy'. </p> <p class="level1">If you start the data with the letter @, the rest should be a filename to read the data from, or - if you want curl to read the data from stdin. Posting data from a file named 'foobar' would thus be done with <a class="emphasis" href="#-d">-d, --data</a> @foobar. When <a class="emphasis" href="#-d">-d, --data</a> is told to read from a file like that, carriage returns, newlines and null bytes are stripped out. If you do not want the @ character to have a special interpretation use <a class="emphasis" href="#--data-raw">--data-raw</a> instead. </p> <p class="level1">The data for this option is passed on to the server exactly as provided on the command line. curl does not convert, change or improve it. It is up to the user to provide the data in the correct form. </p> <p class="level1">--data can be used several times in a command line </p> <p class="level1">Examples: </p><pre class="level1"> curl -d "name=curl" https://example.com curl -d "name=curl" -d "tool=cmdline" https://example.com curl -d @filename https://example.com </pre> <p class="level1">This option is mutually exclusive with <a class="emphasis" href="#-F">-F, --form</a>, <a class="emphasis" href="#-I">-I, --head</a> and <a class="emphasis" href="#-T">-T, --upload-file</a>. See also <a class="emphasis" href="#--data-binary">--data-binary</a>, <a class="emphasis" href="#--data-urlencode">--data-urlencode</a> and <a class="emphasis" href="#--data-raw">--data-raw</a>. </p> <p class="level0"><a name="--data-ascii"></a><span class="nroffip">--data-ascii <data></span> </p> <p class="level1">(HTTP) This option is just an alias for <a class="emphasis" href="#-d">-d, --data</a>. </p> <p class="level1">--data-ascii can be used several times in a command line </p> <p class="level1">Example: </p><pre class="level1"> curl --data-ascii @file https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--data-binary">--data-binary</a>, <a class="emphasis" href="#--data-raw">--data-raw</a> and <a class="emphasis" href="#--data-urlencode">--data-urlencode</a>. </p> <p class="level0"><a name="--data-binary"></a><span class="nroffip">--data-binary <data></span> </p> <p class="level1">(HTTP) Post data exactly as specified with no extra processing whatsoever. </p> <p class="level1">If you start the data with the letter @, the rest should be a filename. "@-" makes curl read the data from stdin. Data is posted in a similar manner as <a class="emphasis" href="#-d">-d, --data</a> does, except that newlines and carriage returns are preserved and conversions are never done. </p> <p class="level1">Like <a class="emphasis" href="#-d">-d, --data</a> the default content-type sent to the server is application/x-www-form-urlencoded. If you want the data to be treated as arbitrary binary data by the server then set the content-type to octet-stream: -H "Content-Type: application/octet-stream". </p> <p class="level1">If this option is used several times, the ones following the first append data as described in <a class="emphasis" href="#-d">-d, --data</a>. </p> <p class="level1">--data-binary can be used several times in a command line </p> <p class="level1">Example: </p><pre class="level1"> curl --data-binary @filename https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--data-ascii">--data-ascii</a>. </p> <p class="level0"><a name="--data-raw"></a><span class="nroffip">--data-raw <data></span> </p> <p class="level1">(HTTP) Post data similarly to <a class="emphasis" href="#-d">-d, --data</a> but without the special interpretation of the @ character. </p> <p class="level1">--data-raw can be used several times in a command line </p> <p class="level1">Examples: </p><pre class="level1"> curl --data-raw "hello" https://example.com curl --data-raw "@at@at@" https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-d">-d, --data</a>. </p> <p class="level0"><a name="--data-urlencode"></a><span class="nroffip">--data-urlencode <data></span> </p> <p class="level1">(HTTP) Post data, similar to the other <a class="emphasis" href="#-d">-d, --data</a> options with the exception that this performs URL-encoding. </p> <p class="level1">To be CGI-compliant, the <data> part should begin with a <span Class="emphasis">name</span> followed by a separator and a content specification. The <data> part can be passed to curl using one of the following syntaxes: </p> <p class="level1"><a name="content"></a><span class="nroffip">content</span> </p> <p class="level2">URL-encode the content and pass that on. Just be careful so that the content does not contain any "=" or "@" symbols, as that makes the syntax match one of the other cases below. </p> <p class="level1"><a name="content"></a><span class="nroffip">=content</span> </p> <p class="level2">URL-encode the content and pass that on. The preceding "=" symbol is not included in the data. </p> <p class="level1"><a name="namecontent"></a><span class="nroffip">name=content</span> </p> <p class="level2">URL-encode the content part and pass that on. Note that the name part is expected to be URL-encoded already. </p> <p class="level1"><a name="filename"></a><span class="nroffip">@filename</span> </p> <p class="level2">load data from the given file (including any newlines), URL-encode that data and pass it on in the POST. Using "@-" makes curl read the data from stdin. </p> <p class="level1"><a name="namefilename"></a><span class="nroffip">name@filename</span> </p> <p class="level2">load data from the given file (including any newlines), URL-encode that data and pass it on in the POST. The name part gets an equal sign appended, resulting in <span Class="emphasis">name=urlencoded-file-content</span>. Note that the name is expected to be URL-encoded already. </p> <p class="level0"><a name=""></a><span class="nroffip"></span> </p> <p class="level1">--data-urlencode can be used several times in a command line </p> <p class="level1">Examples: </p><pre class="level1"> curl --data-urlencode name=val https://example.com curl --data-urlencode =encodethis https://example.com curl --data-urlencode name@file https://example.com curl --data-urlencode @fileonly https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-d">-d, --data</a> and <a class="emphasis" href="#--data-raw">--data-raw</a>. </p> <p class="level0"><a name="--delegation"></a><span class="nroffip">--delegation <LEVEL></span> </p> <p class="level1">(GSS/kerberos) Set LEVEL what curl is allowed to delegate when it comes to user credentials. </p> <p class="level1"><a name="none"></a><span class="nroffip">none</span> </p> <p class="level2">Do not allow any delegation. </p> <p class="level1"><a name="policy"></a><span class="nroffip">policy</span> </p> <p class="level2">Delegates if and only if the OK-AS-DELEGATE flag is set in the Kerberos service ticket, which is a matter of realm policy. </p> <p class="level1"><a name="always"></a><span class="nroffip">always</span> </p> <p class="level2">Unconditionally allow the server to delegate. </p> <p class="level0"><a name=""></a><span class="nroffip"></span> </p> <p class="level1">If --delegation is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --delegation "none" https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-k">-k, --insecure</a> and <a class="emphasis" href="#--ssl">--ssl</a>. </p> <p class="level0"><a name="--digest"></a><span class="nroffip">--digest</span> </p> <p class="level1">(HTTP) Enables HTTP Digest authentication. This authentication scheme avoids sending the password over the wire in clear text. Use this in combination with the normal <a class="emphasis" href="#-u">-u, --user</a> option to set username and password. </p> <p class="level1">Providing --digest multiple times has no extra effect. Disable it again with --no-digest. </p> <p class="level1">Example: </p><pre class="level1"> curl -u name:password --digest https://example.com </pre> <p class="level1">This option is mutually exclusive with <a class="emphasis" href="#--basic">--basic</a>, <a class="emphasis" href="#--ntlm">--ntlm</a> and <a class="emphasis" href="#--negotiate">--negotiate</a>. See also <a class="emphasis" href="#-u">-u, --user</a>, <a class="emphasis" href="#--proxy-digest">--proxy-digest</a> and <a class="emphasis" href="#--anyauth">--anyauth</a>. </p> <p class="level0"><a name="-q"></a><span class="nroffip">-q, --disable</span> </p> <p class="level1">If used as the <span Class="bold">first</span> parameter on the command line, the <span Class="emphasis">curlrc</span> config file is not read or used. See the <a class="emphasis" href="#-K">-K, --config</a> for details on the default config file search path. </p> <p class="level1">Providing --disable multiple times has no extra effect. Disable it again with --no-disable. </p> <p class="level1">Example: </p><pre class="level1"> curl -q https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-K">-K, --config</a>. </p> <p class="level0"><a name="--disable-eprt"></a><span class="nroffip">--disable-eprt</span> </p> <p class="level1">(FTP) Disable the use of the EPRT and LPRT commands when doing active FTP transfers. Curl normally first attempts to use EPRT before using PORT, but with this option, it uses PORT right away. EPRT is an extension to the original FTP protocol, and does not work on all servers, but enables more functionality in a better way than the traditional PORT command. </p> <p class="level1"><span Class="emphasis">--eprt</span> can be used to explicitly enable EPRT again and <span Class="emphasis">--no-eprt</span> is an alias for <a class="emphasis" href="#--disable-eprt">--disable-eprt</a>. </p> <p class="level1">If the server is accessed using IPv6, this option has no effect as EPRT is necessary then. </p> <p class="level1">Disabling EPRT only changes the active behavior. If you want to switch to passive mode you need to not use <a class="emphasis" href="#-P">-P, --ftp-port</a> or force it with <a class="emphasis" href="#--ftp-pasv">--ftp-pasv</a>. </p> <p class="level1">Providing --disable-eprt multiple times has no extra effect. Disable it again with --no-disable-eprt. </p> <p class="level1">Example: </p><pre class="level1"> curl --disable-eprt ftp://example.com/ </pre> <p class="level1">See also <a class="emphasis" href="#--disable-epsv">--disable-epsv</a> and <a class="emphasis" href="#-P">-P, --ftp-port</a>. </p> <p class="level0"><a name="--disable-epsv"></a><span class="nroffip">--disable-epsv</span> </p> <p class="level1">(FTP) Disable the use of the EPSV command when doing passive FTP transfers. Curl normally first attempts to use EPSV before PASV, but with this option, it does not try EPSV. </p> <p class="level1"><span Class="emphasis">--epsv</span> can be used to explicitly enable EPSV again and <span Class="emphasis">--no-epsv</span> is an alias for <a class="emphasis" href="#--disable-epsv">--disable-epsv</a>. </p> <p class="level1">If the server is an IPv6 host, this option has no effect as EPSV is necessary then. </p> <p class="level1">Disabling EPSV only changes the passive behavior. If you want to switch to active mode you need to use <a class="emphasis" href="#-P">-P, --ftp-port</a>. </p> <p class="level1">Providing --disable-epsv multiple times has no extra effect. Disable it again with --no-disable-epsv. </p> <p class="level1">Example: </p><pre class="level1"> curl --disable-epsv ftp://example.com/ </pre> <p class="level1">See also <a class="emphasis" href="#--disable-eprt">--disable-eprt</a> and <a class="emphasis" href="#-P">-P, --ftp-port</a>. </p> <p class="level0"><a name="--disallow-username-in-url"></a><span class="nroffip">--disallow-username-in-url</span> </p> <p class="level1">Exit with error if passed a URL containing a username. Probably most useful when the URL is being provided at runtime or similar. </p> <p class="level1">Providing --disallow-username-in-url multiple times has no extra effect. Disable it again with --no-disallow-username-in-url. </p> <p class="level1">Example: </p><pre class="level1"> curl --disallow-username-in-url https://example.com </pre> <p class="level1">Added in 7.61.0. See also <a class="emphasis" href="#--proto">--proto</a>. </p> <p class="level0"><a name="--dns-interface"></a><span class="nroffip">--dns-interface <interface></span> </p> <p class="level1">(DNS) Send outgoing DNS requests through the given interface. This option is a counterpart to <a class="emphasis" href="#--interface">--interface</a> (which does not affect DNS). The supplied string must be an interface name (not an address). </p> <p class="level1">If --dns-interface is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --dns-interface eth0 https://example.com </pre> <p class="level1"><a class="emphasis" href="#--dns-interface">--dns-interface</a> requires that libcurl is built to support c-ares. See also <a class="emphasis" href="#--dns-ipv4-addr">--dns-ipv4-addr</a> and <a class="emphasis" href="#--dns-ipv6-addr">--dns-ipv6-addr</a>. </p> <p class="level0"><a name="--dns-ipv4-addr"></a><span class="nroffip">--dns-ipv4-addr <address></span> </p> <p class="level1">(DNS) Bind to a specific IP address when making IPv4 DNS requests, so that the DNS requests originate from this address. The argument should be a single IPv4 address. </p> <p class="level1">If --dns-ipv4-addr is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --dns-ipv4-addr 10.1.2.3 https://example.com </pre> <p class="level1"><a class="emphasis" href="#--dns-ipv4-addr">--dns-ipv4-addr</a> requires that libcurl is built to support c-ares. See also <a class="emphasis" href="#--dns-interface">--dns-interface</a> and <a class="emphasis" href="#--dns-ipv6-addr">--dns-ipv6-addr</a>. </p> <p class="level0"><a name="--dns-ipv6-addr"></a><span class="nroffip">--dns-ipv6-addr <address></span> </p> <p class="level1">(DNS) Bind to a specific IP address when making IPv6 DNS requests, so that the DNS requests originate from this address. The argument should be a single IPv6 address. </p> <p class="level1">If --dns-ipv6-addr is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --dns-ipv6-addr 2a04:4e42::561 https://example.com </pre> <p class="level1"><a class="emphasis" href="#--dns-ipv6-addr">--dns-ipv6-addr</a> requires that libcurl is built to support c-ares. See also <a class="emphasis" href="#--dns-interface">--dns-interface</a> and <a class="emphasis" href="#--dns-ipv4-addr">--dns-ipv4-addr</a>. </p> <p class="level0"><a name="--dns-servers"></a><span class="nroffip">--dns-servers <addresses></span> </p> <p class="level1">(DNS) Set the list of DNS servers to be used instead of the system default. The list of IP addresses should be separated with commas. Port numbers may also optionally be given, appended to the IP address separated with a colon. </p> <p class="level1">If --dns-servers is provided several times, the last set value is used. </p> <p class="level1">Examples: </p><pre class="level1"> curl --dns-servers 192.168.0.1,192.168.0.2 https://example.com curl --dns-servers 10.0.0.1:53 https://example.com </pre> <p class="level1"><a class="emphasis" href="#--dns-servers">--dns-servers</a> requires that libcurl is built to support c-ares. See also <a class="emphasis" href="#--dns-interface">--dns-interface</a> and <a class="emphasis" href="#--dns-ipv4-addr">--dns-ipv4-addr</a>. </p> <p class="level0"><a name="--doh-cert-status"></a><span class="nroffip">--doh-cert-status</span> </p> <p class="level1">Same as <a class="emphasis" href="#--cert-status">--cert-status</a> but used for DoH (DNS-over-HTTPS). </p> <p class="level1">Verifies the status of the DoH servers' certificate by using the Certificate Status Request (aka. OCSP stapling) TLS extension. </p> <p class="level1">If this option is enabled and the DoH server sends an invalid (e.g. expired) response, if the response suggests that the server certificate has been revoked, or no response at all is received, the verification fails. </p> <p class="level1">This support is currently only implemented in the OpenSSL and GnuTLS backends. </p> <p class="level1">Providing --doh-cert-status multiple times has no extra effect. Disable it again with --no-doh-cert-status. </p> <p class="level1">Example: </p><pre class="level1"> curl --doh-cert-status --doh-url https://doh.example https://example.com </pre> <p class="level1">Added in 7.76.0. See also <a class="emphasis" href="#--doh-insecure">--doh-insecure</a>. </p> <p class="level0"><a name="--doh-insecure"></a><span class="nroffip">--doh-insecure</span> </p> <p class="level1">By default, every connection curl makes to a DoH server is verified to be secure before the transfer takes place. This option tells curl to skip the verification step and proceed without checking. </p> <p class="level1"><span Class="bold">WARNING</span>: using this option makes the DoH transfer and name resolution insecure. </p> <p class="level1">This option is equivalent to <a class="emphasis" href="#-k">-k, --insecure</a> and <a class="emphasis" href="#--proxy-insecure">--proxy-insecure</a> but used for DoH (DNS-over-HTTPS) only. </p> <p class="level1">Providing --doh-insecure multiple times has no extra effect. Disable it again with --no-doh-insecure. </p> <p class="level1">Example: </p><pre class="level1"> curl --doh-insecure --doh-url https://doh.example https://example.com </pre> <p class="level1">Added in 7.76.0. See also <a class="emphasis" href="#--doh-url">--doh-url</a>, <a class="emphasis" href="#-k">-k, --insecure</a> and <a class="emphasis" href="#--proxy-insecure">--proxy-insecure</a>. </p> <p class="level0"><a name="--doh-url"></a><span class="nroffip">--doh-url <URL></span> </p> <p class="level1">Specifies which DNS-over-HTTPS (DoH) server to use to resolve hostnames, instead of using the default name resolver mechanism. The URL must be HTTPS. </p> <p class="level1">Some SSL options that you set for your transfer also applies to DoH since the name lookups take place over SSL. However, the certificate verification settings are not inherited but are controlled separately via <a class="emphasis" href="#--doh-insecure">--doh-insecure</a> and <a class="emphasis" href="#--doh-cert-status">--doh-cert-status</a>. </p> <p class="level1">By default, DoH is bypassed when initially looking up DNS records of the DoH server. You can specify the IP address(es) of the DoH server with <a class="emphasis" href="#--resolve">--resolve</a> to avoid this. </p> <p class="level1">This option is unset if an empty string "" is used as the URL. (Added in 7.85.0) </p> <p class="level1">If --doh-url is provided several times, the last set value is used. </p> <p class="level1">Examples: </p><pre class="level1"> curl --doh-url https://doh.example https://example.com curl --doh-url https://doh.example --resolve doh.example:443:192.0.2.1 https://example.com </pre> <p class="level1">Added in 7.62.0. See also <a class="emphasis" href="#--doh-insecure">--doh-insecure</a>. </p> <p class="level0"><a name="--dump-ca-embed"></a><span class="nroffip">--dump-ca-embed</span> </p> <p class="level1">(TLS) Write the CA bundle embedded in curl to standard output, then quit. </p> <p class="level1">If curl was not built with a default CA bundle embedded, the output is empty. </p> <p class="level1">Providing --dump-ca-embed multiple times has no extra effect. Disable it again with --no-dump-ca-embed. </p> <p class="level1">Example: </p><pre class="level1"> curl --dump-ca-embed </pre> <p class="level1">Added in 8.10.0. See also <a class="emphasis" href="#--ca-native">--ca-native</a>, <a class="emphasis" href="#--cacert">--cacert</a>, <a class="emphasis" href="#--capath">--capath</a>, <a class="emphasis" href="#--proxy-ca-native">--proxy-ca-native</a>, <a class="emphasis" href="#--proxy-cacert">--proxy-cacert</a> and <a class="emphasis" href="#--proxy-capath">--proxy-capath</a>. </p> <p class="level0"><a name="-D"></a><span class="nroffip">-D, --dump-header <filename></span> </p> <p class="level1">(HTTP FTP) Write the received protocol headers to the specified file. If no headers are received, the use of this option creates an empty file. Specify "-" as filename (a single minus) to have it written to stdout. </p> <p class="level1">Starting in curl 8.10.0, specify "%" (a single percent sign) as filename writes the output to stderr. </p> <p class="level1">When used in FTP, the FTP server response lines are considered being "headers" and thus are saved there. </p> <p class="level1">Starting in curl 8.11.0, using the <a class="emphasis" href="#--create-dirs">--create-dirs</a> option can also create missing directory components for the path provided in <a class="emphasis" href="#-D">-D, --dump-header</a>. </p> <p class="level1">Having multiple transfers in one set of operations (i.e. the URLs in one <a class="emphasis" href="#-">-:, --next</a> clause), appends them to the same file, separated by a blank line. </p> <p class="level1">If --dump-header is provided several times, the last set value is used. </p> <p class="level1">Examples: </p><pre class="level1"> curl --dump-header store.txt https://example.com curl --dump-header - https://example.com -o save </pre> <p class="level1">See also <a class="emphasis" href="#-o">-o, --output</a>. </p> <p class="level0"><a name="--ech"></a><span class="nroffip">--ech <config></span> </p> <p class="level1">(HTTPS) Specifies how to do ECH (Encrypted Client Hello). </p> <p class="level1">The values allowed for <config> can be: </p> <p class="level1"><a name="false"></a><span class="nroffip">false</span> </p> <p class="level2">Do not attempt ECH. The is the default. </p> <p class="level1"><a name="grease"></a><span class="nroffip">grease</span> </p> <p class="level2">Send a GREASE ECH extension </p> <p class="level1"><a name="true"></a><span class="nroffip">true</span> </p> <p class="level2">Attempt ECH if possible, but do not fail if ECH is not attempted. (The connection fails if ECH is attempted but fails.) </p> <p class="level1"><a name="hard"></a><span class="nroffip">hard</span> </p> <p class="level2">Attempt ECH and fail if that is not possible. ECH only works with TLS 1.3 and also requires using DoH or providing an ECHConfigList on the command line. </p> <p class="level1"><a name="eclb64val"></a><span class="nroffip">ecl:<b64val></span> </p> <p class="level2">A base64 encoded ECHConfigList that is used for ECH. </p> <p class="level1"><a name="pnname"></a><span class="nroffip">pn:<name></span> </p> <p class="level2">A name to use to over-ride the "public_name" field of an ECHConfigList (only available with OpenSSL TLS support) </p> <p class="level0"><a name=""></a><span class="nroffip"></span> </p> <p class="level1">Most ECH related errors cause error <span Class="emphasis">CURLE_ECH_REQUIRED</span> (101). </p> <p class="level1">If --ech is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --ech true https://example.com </pre> <p class="level1">Added in 8.8.0. See also <a class="emphasis" href="#--doh-url">--doh-url</a>. </p> <p class="level0"><a name="--egd-file"></a><span class="nroffip">--egd-file <file></span> </p> <p class="level1">(TLS) Deprecated option (added in 7.84.0). Prior to that it only had an effect on curl if built to use old versions of OpenSSL. </p> <p class="level1">Specify the path name to the Entropy Gathering Daemon socket. The socket is used to seed the random engine for SSL connections. </p> <p class="level1">If --egd-file is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --egd-file /random/here https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--random-file">--random-file</a>. </p> <p class="level0"><a name="--engine"></a><span class="nroffip">--engine <name></span> </p> <p class="level1">(TLS) Select the OpenSSL crypto engine to use for cipher operations. Use <a class="emphasis" href="#--engine">--engine</a> list to print a list of build-time supported engines. Note that not all (and possibly none) of the engines may be available at runtime. </p> <p class="level1">If --engine is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --engine flavor https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--ciphers">--ciphers</a> and <a class="emphasis" href="#--curves">--curves</a>. </p> <p class="level0"><a name="--etag-compare"></a><span class="nroffip">--etag-compare <file></span> </p> <p class="level1">(HTTP) Make a conditional HTTP request for the specific ETag read from the given file by sending a custom If-None-Match header using the stored ETag. </p> <p class="level1">For correct results, make sure that the specified file contains only a single line with the desired ETag. An empty file is parsed as an empty ETag. </p> <p class="level1">Use the option <a class="emphasis" href="#--etag-save">--etag-save</a> to first save the ETag from a response, and then use this option to compare against the saved ETag in a subsequent request. </p> <p class="level1">If --etag-compare is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --etag-compare etag.txt https://example.com </pre> <p class="level1">Added in 7.68.0. See also <a class="emphasis" href="#--etag-save">--etag-save</a> and <a class="emphasis" href="#-z">-z, --time-cond</a>. </p> <p class="level0"><a name="--etag-save"></a><span class="nroffip">--etag-save <file></span> </p> <p class="level1">(HTTP) Save an HTTP ETag to the specified file. An ETag is a caching related header, usually returned in a response. </p> <p class="level1">If no ETag is sent by the server, an empty file is created. </p> <p class="level1">If --etag-save is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --etag-save storetag.txt https://example.com </pre> <p class="level1">Added in 7.68.0. See also <a class="emphasis" href="#--etag-compare">--etag-compare</a>. </p> <p class="level0"><a name="--expect100-timeout"></a><span class="nroffip">--expect100-timeout <seconds></span> </p> <p class="level1">(HTTP) Maximum time in seconds that you allow curl to wait for a 100-continue response when curl emits an Expects: 100-continue header in its request. By default curl waits one second. This option accepts decimal values. When curl stops waiting, it continues as if a response was received. </p> <p class="level1">The decimal value needs to be provided using a dot (".") as decimal separator - not the local version even if it might be using another separator. </p> <p class="level1">If --expect100-timeout is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --expect100-timeout 2.5 -T file https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--connect-timeout">--connect-timeout</a>. </p> <p class="level0"><a name="-f"></a><span class="nroffip">-f, --fail</span> </p> <p class="level1">(HTTP) Fail with error code 22 and with no response body output at all for HTTP transfers returning HTTP response codes at 400 or greater. </p> <p class="level1">In normal cases when an HTTP server fails to deliver a document, it returns a body of text stating so (which often also describes why and more) and a 4xx HTTP response code. This command line option prevents curl from outputting that data and instead returns error 22 early. By default, curl does not consider HTTP response codes to indicate failure. </p> <p class="level1">To get both the error code and also save the content, use <a class="emphasis" href="#--fail-with-body">--fail-with-body</a> instead. </p> <p class="level1">This method is not fail-safe and there are occasions where non-successful response codes slip through, especially when authentication is involved (response codes 401 and 407). </p> <p class="level1">Providing --fail multiple times has no extra effect. Disable it again with --no-fail. </p> <p class="level1">Example: </p><pre class="level1"> curl --fail https://example.com </pre> <p class="level1">This option is mutually exclusive with <a class="emphasis" href="#--fail-with-body">--fail-with-body</a>. See also <a class="emphasis" href="#--fail-with-body">--fail-with-body</a> and <a class="emphasis" href="#--fail-early">--fail-early</a>. </p> <p class="level0"><a name="--fail-early"></a><span class="nroffip">--fail-early</span> </p> <p class="level1">Fail and exit on the first detected transfer error. </p> <p class="level1">When curl is used to do multiple transfers on the command line, it attempts to operate on each given URL, one by one. By default, it ignores errors if there are more URLs given and the last URL's success determines the error code curl returns. Early failures are "hidden" by subsequent successful transfers. </p> <p class="level1">Using this option, curl instead returns an error on the first transfer that fails, independent of the amount of URLs that are given on the command line. This way, no transfer failures go undetected by scripts and similar. </p> <p class="level1">This option does not imply <a class="emphasis" href="#-f">-f, --fail</a>, which causes transfers to fail due to the server's HTTP status code. You can combine the two options, however note <a class="emphasis" href="#-f">-f, --fail</a> is not global and is therefore contained by <a class="emphasis" href="#-">-:, --next</a>. </p> <p class="level1">This option is global and does not need to be specified for each use of --next. </p> <p class="level1">Providing --fail-early multiple times has no extra effect. Disable it again with --no-fail-early. </p> <p class="level1">Example: </p><pre class="level1"> curl --fail-early https://example.com https://two.example </pre> <p class="level1">See also <a class="emphasis" href="#-f">-f, --fail</a> and <a class="emphasis" href="#--fail-with-body">--fail-with-body</a>. </p> <p class="level0"><a name="--fail-with-body"></a><span class="nroffip">--fail-with-body</span> </p> <p class="level1">(HTTP) Return an error on server errors where the HTTP response code is 400 or greater). In normal cases when an HTTP server fails to deliver a document, it returns an HTML document stating so (which often also describes why and more). This option allows curl to output and save that content but also to return error 22. </p> <p class="level1">This is an alternative option to <a class="emphasis" href="#-f">-f, --fail</a> which makes curl fail for the same circumstances but without saving the content. </p> <p class="level1">Providing --fail-with-body multiple times has no extra effect. Disable it again with --no-fail-with-body. </p> <p class="level1">Example: </p><pre class="level1"> curl --fail-with-body https://example.com </pre> <p class="level1">This option is mutually exclusive with <a class="emphasis" href="#-f">-f, --fail</a>. Added in 7.76.0. See also <a class="emphasis" href="#-f">-f, --fail</a> and <a class="emphasis" href="#--fail-early">--fail-early</a>. </p> <p class="level0"><a name="--false-start"></a><span class="nroffip">--false-start</span> </p> <p class="level1">(TLS) Use false start during the TLS handshake. False start is a mode where a TLS client starts sending application data before verifying the server's Finished message, thus saving a round trip when performing a full handshake. </p> <p class="level1">This functionality is currently only implemented in the Secure Transport (on iOS 7.0 or later, or macOS 10.9 or later) backend. </p> <p class="level1">Providing --false-start multiple times has no extra effect. Disable it again with --no-false-start. </p> <p class="level1">Example: </p><pre class="level1"> curl --false-start https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--tcp-fastopen">--tcp-fastopen</a>. </p> <p class="level0"><a name="-F"></a><span class="nroffip">-F, --form <name=content></span> </p> <p class="level1">(HTTP SMTP IMAP) For the HTTP protocol family, emulate a filled-in form in which a user has pressed the submit button. This makes curl POST data using the Content-Type multipart/form-data according to <a href="https://www.ietf.org/rfc/rfc2388.txt">RFC 2388</a>. </p> <p class="level1">For SMTP and IMAP protocols, this composes a multipart mail message to transmit. </p> <p class="level1">This enables uploading of binary files etc. To force the 'content' part to be a file, prefix the filename with an @ sign. To just get the content part from a file, prefix the filename with the symbol <. The difference between @ and < is then that @ makes a file get attached in the post as a file upload, while the < makes a text field and just get the contents for that text field from a file. </p> <p class="level1">Read content from stdin instead of a file by using a single "-" as filename. This goes for both @ and < constructs. When stdin is used, the contents is buffered in memory first by curl to determine its size and allow a possible resend. Defining a part's data from a named non-regular file (such as a named pipe or similar) is not subject to buffering and is instead read at transmission time; since the full size is unknown before the transfer starts, such data is sent as chunks by HTTP and rejected by IMAP. </p> <p class="level1">Example: send an image to an HTTP server, where 'profile' is the name of the form-field to which the file <span Class="bold">portrait.jpg</span> is the input: </p><pre class="level1"> curl -F profile=@portrait.jpg https://example.com/upload.cgi </pre> <p class="level1">Example: send your name and shoe size in two text fields to the server: </p><pre class="level1"> curl -F name=John -F shoesize=11 https://example.com/ </pre> <p class="level1">Example: send your essay in a text field to the server. Send it as a plain text field, but get the contents for it from a local file: </p><pre class="level1"> curl -F "story=<hugefile.txt" https://example.com/ </pre> <p class="level1">You can also instruct curl what Content-Type to use by using "type=", in a manner similar to: </p><pre class="level1"> curl -F "web=@index.html;type=text/html" example.com </pre> <p class="level1">or </p><pre class="level1"> curl -F "name=daniel;type=text/foo" example.com </pre> <p class="level1">You can also explicitly change the name field of a file upload part by setting filename=, like this: </p><pre class="level1"> curl -F "file=@localfile;filename=nameinpost" example.com </pre> <p class="level1">If filename/path contains ',' or ';', it must be quoted by double-quotes like: </p><pre class="level1"> curl -F "file=@\"local,file\";filename=\"name;in;post\"" \ https://example.com </pre> <p class="level1">or </p><pre class="level1"> curl -F 'file=@"local,file";filename="name;in;post"' \ https://example.com </pre> <p class="level1">Note that if a filename/path is quoted by double-quotes, any double-quote or backslash within the filename must be escaped by backslash. </p> <p class="level1">Quoting must also be applied to non-file data if it contains semicolons, leading/trailing spaces or leading double quotes: </p><pre class="level1"> curl -F 'colors="red; green; blue";type=text/x-myapp' \ https://example.com </pre> <p class="level1">You can add custom headers to the field by setting headers=, like </p><pre class="level1"> curl -F "submit=OK;headers=\"X-submit-type: OK\"" example.com </pre> <p class="level1">or </p><pre class="level1"> curl -F "submit=OK;headers=@headerfile" example.com </pre> <p class="level1">The headers= keyword may appear more that once and above notes about quoting apply. When headers are read from a file, Empty lines and lines starting with '#' are comments and ignored; each header can be folded by splitting between two words and starting the continuation line with a space; embedded carriage-returns and trailing spaces are stripped. Here is an example of a header file contents: </p><pre class="level1"> # This file contain two headers. X-header-1: this is a header # The following header is folded. X-header-2: this is another header </pre> <p class="level1">To support sending multipart mail messages, the syntax is extended as follows: </p> <p class="level1">- name can be omitted: the equal sign is the first character of the argument, </p> <p class="level1">- if data starts with '(', this signals to start a new multipart: it can be followed by a content type specification. </p> <p class="level1">- a multipart can be terminated with a '=)' argument. </p> <p class="level1">Example: the following command sends an SMTP mime email consisting in an inline part in two alternative formats: plain text and HTML. It attaches a text file: </p><pre class="level1"> curl -F '=(;type=multipart/alternative' \ -F '=plain text message' \ -F '= <body>HTML message</body>;type=text/html' \ -F '=)' -F '=@textfile.txt' ... smtp://example.com </pre> <p class="level1">Data can be encoded for transfer using encoder=. Available encodings are <span Class="emphasis">binary</span> and <span Class="emphasis">8bit</span> that do nothing else than adding the corresponding Content-Transfer-Encoding header, <span Class="emphasis">7bit</span> that only rejects 8-bit characters with a transfer error, <span Class="emphasis">quoted-printable</span> and <span Class="emphasis">base64</span> that encodes data according to the corresponding schemes, limiting lines length to 76 characters. </p> <p class="level1">Example: send multipart mail with a quoted-printable text message and a base64 attached file: </p><pre class="level1"> curl -F '=text message;encoder=quoted-printable' \ -F '=@localfile;encoder=base64' ... smtp://example.com </pre> <p class="level1">See further examples and details in the MANUAL. </p> <p class="level1">--form can be used several times in a command line </p> <p class="level1">Example: </p><pre class="level1"> curl --form "name=curl" --form "file=@loadthis" https://example.com </pre> <p class="level1">This option is mutually exclusive with <a class="emphasis" href="#-d">-d, --data</a>, <a class="emphasis" href="#-I">-I, --head</a> and <a class="emphasis" href="#-T">-T, --upload-file</a>. See also <a class="emphasis" href="#-d">-d, --data</a>, <a class="emphasis" href="#--form-string">--form-string</a> and <a class="emphasis" href="#--form-escape">--form-escape</a>. </p> <p class="level0"><a name="--form-escape"></a><span class="nroffip">--form-escape</span> </p> <p class="level1">(HTTP imap smtp) Pass on names of multipart form fields and files using backslash-escaping instead of percent-encoding. </p> <p class="level1">If --form-escape is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --form-escape -F 'field\name=curl' -F 'file=@load"this' https://example.com </pre> <p class="level1">Added in 7.81.0. See also <a class="emphasis" href="#-F">-F, --form</a>. </p> <p class="level0"><a name="--form-string"></a><span class="nroffip">--form-string <name=string></span> </p> <p class="level1">(HTTP SMTP IMAP) Similar to <a class="emphasis" href="#-F">-F, --form</a> except that the value string for the named parameter is used literally. Leading @ and < characters, and the ";type=" string in the value have no special meaning. Use this in preference to <a class="emphasis" href="#-F">-F, --form</a> if there is any possibility that the string value may accidentally trigger the @ or < features of <a class="emphasis" href="#-F">-F, --form</a>. </p> <p class="level1">--form-string can be used several times in a command line </p> <p class="level1">Example: </p><pre class="level1"> curl --form-string "name=data" https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-F">-F, --form</a>. </p> <p class="level0"><a name="--ftp-account"></a><span class="nroffip">--ftp-account <data></span> </p> <p class="level1">(FTP) When an FTP server asks for "account data" after username and password has been provided, this data is sent off using the ACCT command. </p> <p class="level1">If --ftp-account is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --ftp-account "mr.robot" ftp://example.com/ </pre> <p class="level1">See also <a class="emphasis" href="#-u">-u, --user</a>. </p> <p class="level0"><a name="--ftp-alternative-to-user"></a><span class="nroffip">--ftp-alternative-to-user <command></span> </p> <p class="level1">(FTP) If authenticating with the USER and PASS commands fails, send this command. When connecting to Tumbleweed's Secure Transport server over FTPS using a client certificate, using "SITE AUTH" tells the server to retrieve the username from the certificate. </p> <p class="level1">If --ftp-alternative-to-user is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --ftp-alternative-to-user "U53r" ftp://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--ftp-account">--ftp-account</a> and <a class="emphasis" href="#-u">-u, --user</a>. </p> <p class="level0"><a name="--ftp-create-dirs"></a><span class="nroffip">--ftp-create-dirs</span> </p> <p class="level1">(FTP SFTP) When an FTP or SFTP URL/operation uses a path that does not currently exist on the server, the standard behavior of curl is to fail. Using this option, curl instead attempts to create missing directories. </p> <p class="level1">Providing --ftp-create-dirs multiple times has no extra effect. Disable it again with --no-ftp-create-dirs. </p> <p class="level1">Example: </p><pre class="level1"> curl --ftp-create-dirs -T file ftp://example.com/remote/path/file </pre> <p class="level1">See also <a class="emphasis" href="#--create-dirs">--create-dirs</a>. </p> <p class="level0"><a name="--ftp-method"></a><span class="nroffip">--ftp-method <method></span> </p> <p class="level1">(FTP) Control what method curl should use to reach a file on an FTP(S) server. The method argument should be one of the following alternatives: </p> <p class="level1"><a name="multicwd"></a><span class="nroffip">multicwd</span> </p> <p class="level2">Do a single CWD operation for each path part in the given URL. For deep hierarchies this means many commands. This is how <a href="https://www.ietf.org/rfc/rfc1738.txt">RFC 1738</a> says it should be done. This is the default but the slowest behavior. </p> <p class="level1"><a name="nocwd"></a><span class="nroffip">nocwd</span> </p> <p class="level2">Do no CWD at all. curl does SIZE, RETR, STOR etc and gives the full path to the server for each of these commands. This is the fastest behavior. </p> <p class="level1"><a name="singlecwd"></a><span class="nroffip">singlecwd</span> </p> <p class="level2">Do one CWD with the full target directory and then operate on the file "normally" (like in the multicwd case). This is somewhat more standards compliant than "nocwd" but without the full penalty of "multicwd". </p> <p class="level0"><a name=""></a><span class="nroffip"></span> </p> <p class="level1">If --ftp-method is provided several times, the last set value is used. </p> <p class="level1">Examples: </p><pre class="level1"> curl --ftp-method multicwd ftp://example.com/dir1/dir2/file curl --ftp-method nocwd ftp://example.com/dir1/dir2/file curl --ftp-method singlecwd ftp://example.com/dir1/dir2/file </pre> <p class="level1">See also <a class="emphasis" href="#-l">-l, --list-only</a>. </p> <p class="level0"><a name="--ftp-pasv"></a><span class="nroffip">--ftp-pasv</span> </p> <p class="level1">(FTP) Use passive mode for the data connection. Passive is the internal default behavior, but using this option can be used to override a previous <a class="emphasis" href="#-P">-P, --ftp-port</a> option. </p> <p class="level1">Reversing an enforced passive really is not doable but you must then instead enforce the correct <a class="emphasis" href="#-P">-P, --ftp-port</a> again. </p> <p class="level1">Passive mode means that curl tries the EPSV command first and then PASV, unless <a class="emphasis" href="#--disable-epsv">--disable-epsv</a> is used. </p> <p class="level1">Providing --ftp-pasv multiple times has no extra effect. Disable it again with --no-ftp-pasv. </p> <p class="level1">Example: </p><pre class="level1"> curl --ftp-pasv ftp://example.com/ </pre> <p class="level1">See also <a class="emphasis" href="#--disable-epsv">--disable-epsv</a>. </p> <p class="level0"><a name="-P"></a><span class="nroffip">-P, --ftp-port <address></span> </p> <p class="level1">(FTP) Reverses the default initiator/listener roles when connecting with FTP. This option makes curl use active mode. curl then commands the server to connect back to the client's specified address and port, while passive mode asks the server to setup an IP address and port for it to connect to. <address> should be one of: </p> <p class="level1"><a name="interface"></a><span class="nroffip">interface</span> </p> <p class="level2">e.g. <span Class="bold">eth0</span> to specify which interface's IP address you want to use (Unix only) </p> <p class="level1"><a name="IP"></a><span class="nroffip">IP address</span> </p> <p class="level2">e.g. <span Class="bold">192.168.10.1</span> to specify the exact IP address </p> <p class="level1"><a name="hostname"></a><span class="nroffip">hostname</span> </p> <p class="level2">e.g. <span Class="bold">my.host.domain</span> to specify the machine </p> <p class="level1"><a name="-"></a><span class="nroffip">-</span> </p> <p class="level2">make curl pick the same IP address that is already used for the control connection. This is the recommended choice. </p> <p class="level0"><a name=""></a><span class="nroffip"></span> </p> <p class="level1">Disable the use of PORT with <a class="emphasis" href="#--ftp-pasv">--ftp-pasv</a>. Disable the attempt to use the EPRT command instead of PORT by using <a class="emphasis" href="#--disable-eprt">--disable-eprt</a>. EPRT is really PORT++. </p> <p class="level1">You can also append ":[start]-[end]" to the right of the address, to tell curl what TCP port range to use. That means you specify a port range, from a lower to a higher number. A single number works as well, but do note that it increases the risk of failure since the port may not be available. </p> <p class="level1">If --ftp-port is provided several times, the last set value is used. </p> <p class="level1">Examples: </p><pre class="level1"> curl -P - ftp:/example.com curl -P eth0 ftp:/example.com curl -P 192.168.0.2 ftp:/example.com </pre> <p class="level1">See also <a class="emphasis" href="#--ftp-pasv">--ftp-pasv</a> and <a class="emphasis" href="#--disable-eprt">--disable-eprt</a>. </p> <p class="level0"><a name="--ftp-pret"></a><span class="nroffip">--ftp-pret</span> </p> <p class="level1">(FTP) Send a PRET command before PASV (and EPSV). Certain FTP servers, mainly drftpd, require this non-standard command for directory listings as well as up and downloads in PASV mode. </p> <p class="level1">Providing --ftp-pret multiple times has no extra effect. Disable it again with --no-ftp-pret. </p> <p class="level1">Example: </p><pre class="level1"> curl --ftp-pret ftp://example.com/ </pre> <p class="level1">See also <a class="emphasis" href="#-P">-P, --ftp-port</a> and <a class="emphasis" href="#--ftp-pasv">--ftp-pasv</a>. </p> <p class="level0"><a name="--ftp-skip-pasv-ip"></a><span class="nroffip">--ftp-skip-pasv-ip</span> </p> <p class="level1">(FTP) Do not use the IP address the server suggests in its response to curl's PASV command when curl connects the data connection. Instead curl reuses the same IP address it already uses for the control connection. </p> <p class="level1">This option is enabled by default (added in 7.74.0). </p> <p class="level1">This option has no effect if PORT, EPRT or EPSV is used instead of PASV. </p> <p class="level1">Providing --ftp-skip-pasv-ip multiple times has no extra effect. Disable it again with --no-ftp-skip-pasv-ip. </p> <p class="level1">Example: </p><pre class="level1"> curl --ftp-skip-pasv-ip ftp://example.com/ </pre> <p class="level1">See also <a class="emphasis" href="#--ftp-pasv">--ftp-pasv</a>. </p> <p class="level0"><a name="--ftp-ssl-ccc"></a><span class="nroffip">--ftp-ssl-ccc</span> </p> <p class="level1">(FTP) Use CCC (Clear Command Channel) Shuts down the SSL/TLS layer after authenticating. The rest of the control channel communication is be unencrypted. This allows NAT routers to follow the FTP transaction. The default mode is passive. </p> <p class="level1">Providing --ftp-ssl-ccc multiple times has no extra effect. Disable it again with --no-ftp-ssl-ccc. </p> <p class="level1">Example: </p><pre class="level1"> curl --ftp-ssl-ccc ftps://example.com/ </pre> <p class="level1">See also <a class="emphasis" href="#--ssl">--ssl</a> and <a class="emphasis" href="#--ftp-ssl-ccc-mode">--ftp-ssl-ccc-mode</a>. </p> <p class="level0"><a name="--ftp-ssl-ccc-mode"></a><span class="nroffip">--ftp-ssl-ccc-mode <active/passive></span> </p> <p class="level1">(FTP) Sets the CCC mode. The passive mode does not initiate the shutdown, but instead waits for the server to do it, and does not reply to the shutdown from the server. The active mode initiates the shutdown and waits for a reply from the server. </p> <p class="level1">Providing --ftp-ssl-ccc-mode multiple times has no extra effect. Disable it again with --no-ftp-ssl-ccc-mode. </p> <p class="level1">Example: </p><pre class="level1"> curl --ftp-ssl-ccc-mode active --ftp-ssl-ccc ftps://example.com/ </pre> <p class="level1">See also <a class="emphasis" href="#--ftp-ssl-ccc">--ftp-ssl-ccc</a>. </p> <p class="level0"><a name="--ftp-ssl-control"></a><span class="nroffip">--ftp-ssl-control</span> </p> <p class="level1">(FTP) Require SSL/TLS for the FTP login, clear for transfer. Allows secure authentication, but non-encrypted data transfers for efficiency. Fails the transfer if the server does not support SSL/TLS. </p> <p class="level1">Providing --ftp-ssl-control multiple times has no extra effect. Disable it again with --no-ftp-ssl-control. </p> <p class="level1">Example: </p><pre class="level1"> curl --ftp-ssl-control ftp://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--ssl">--ssl</a>. </p> <p class="level0"><a name="-G"></a><span class="nroffip">-G, --get</span> </p> <p class="level1">(HTTP) When used, this option makes all data specified with <a class="emphasis" href="#-d">-d, --data</a>, <a class="emphasis" href="#--data-binary">--data-binary</a> or <a class="emphasis" href="#--data-urlencode">--data-urlencode</a> to be used in an HTTP GET request instead of the POST request that otherwise would be used. curl appends the provided data to the URL as a query string. </p> <p class="level1">If used in combination with <a class="emphasis" href="#-I">-I, --head</a>, the POST data is instead appended to the URL with a HEAD request. </p> <p class="level1">Providing --get multiple times has no extra effect. Disable it again with --no-get. </p> <p class="level1">Examples: </p><pre class="level1"> curl --get https://example.com curl --get -d "tool=curl" -d "age=old" https://example.com curl --get -I -d "tool=curl" https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-d">-d, --data</a> and <a class="emphasis" href="#-X">-X, --request</a>. </p> <p class="level0"><a name="-g"></a><span class="nroffip">-g, --globoff</span> </p> <p class="level1">Switch off the URL globbing function. When you set this option, you can specify URLs that contain the letters {}[] without having curl itself interpret them. Note that these letters are not normal legal URL contents but they should be encoded according to the URI standard. </p> <p class="level1">Providing --globoff multiple times has no extra effect. Disable it again with --no-globoff. </p> <p class="level1">Example: </p><pre class="level1"> curl -g "https://example.com/{[]}}}}" </pre> <p class="level1">See also <a class="emphasis" href="#-K">-K, --config</a> and <a class="emphasis" href="#-q">-q, --disable</a>. </p> <p class="level0"><a name="--happy-eyeballs-timeout-ms"></a><span class="nroffip">--happy-eyeballs-timeout-ms <ms></span> </p> <p class="level1">Happy Eyeballs is an algorithm that attempts to connect to both IPv4 and IPv6 addresses for dual-stack hosts, giving IPv6 a head-start of the specified number of milliseconds. If the IPv6 address cannot be connected to within that time, then a connection attempt is made to the IPv4 address in parallel. The first connection to be established is the one that is used. </p> <p class="level1">The range of suggested useful values is limited. Happy Eyeballs <a href="https://www.ietf.org/rfc/rfc6555.txt">RFC 6555</a> says "It is RECOMMENDED that connection attempts be paced 150-250 ms apart to balance human factors against network load." libcurl currently defaults to 200 ms. Firefox and Chrome currently default to 300 ms. </p> <p class="level1">If --happy-eyeballs-timeout-ms is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --happy-eyeballs-timeout-ms 500 https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-m">-m, --max-time</a> and <a class="emphasis" href="#--connect-timeout">--connect-timeout</a>. </p> <p class="level0"><a name="--haproxy-clientip"></a><span class="nroffip">--haproxy-clientip <ip></span> </p> <p class="level1">(HTTP) Sets a client IP in HAProxy PROXY protocol v1 header at the beginning of the connection. </p> <p class="level1">For valid requests, IPv4 addresses must be indicated as a series of exactly 4 integers in the range [0..255] inclusive written in decimal representation separated by exactly one dot between each other. Heading zeroes are not permitted in front of numbers in order to avoid any possible confusion with octal numbers. IPv6 addresses must be indicated as series of 4 hexadecimal digits (upper or lower case) delimited by colons between each other, with the acceptance of one double colon sequence to replace the largest acceptable range of consecutive zeroes. The total number of decoded bits must exactly be 128. </p> <p class="level1">Otherwise, any string can be accepted for the client IP and get sent. </p> <p class="level1">It replaces <a class="emphasis" href="#--haproxy-protocol">--haproxy-protocol</a> if used, it is not necessary to specify both flags. </p> <p class="level1">If --haproxy-clientip is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --haproxy-clientip $IP </pre> <p class="level1">Added in 8.2.0. See also <a class="emphasis" href="#-x">-x, --proxy</a>. </p> <p class="level0"><a name="--haproxy-protocol"></a><span class="nroffip">--haproxy-protocol</span> </p> <p class="level1">(HTTP) Send a HAProxy PROXY protocol v1 header at the beginning of the connection. This is used by some load balancers and reverse proxies to indicate the client's true IP address and port. </p> <p class="level1">This option is primarily useful when sending test requests to a service that expects this header. </p> <p class="level1">Providing --haproxy-protocol multiple times has no extra effect. Disable it again with --no-haproxy-protocol. </p> <p class="level1">Example: </p><pre class="level1"> curl --haproxy-protocol https://example.com </pre> <p class="level1">Added in 7.60.0. See also <a class="emphasis" href="#-x">-x, --proxy</a>. </p> <p class="level0"><a name="-I"></a><span class="nroffip">-I, --head</span> </p> <p class="level1">(HTTP FTP FILE) Fetch the headers only. HTTP-servers feature the command HEAD which this uses to get nothing but the header of a document. When used on an FTP or FILE URL, curl displays the file size and last modification time only. </p> <p class="level1">Providing --head multiple times has no extra effect. Disable it again with --no-head. </p> <p class="level1">Example: </p><pre class="level1"> curl -I https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-G">-G, --get</a>, <a class="emphasis" href="#-v">-v, --verbose</a> and <a class="emphasis" href="#--trace-ascii">--trace-ascii</a>. </p> <p class="level0"><a name="-H"></a><span class="nroffip">-H, --header <header/@file></span> </p> <p class="level1">(HTTP IMAP SMTP) Extra header to include in information sent. When used within an HTTP request, it is added to the regular request headers. </p> <p class="level1">For an IMAP or SMTP MIME uploaded mail built with <a class="emphasis" href="#-F">-F, --form</a> options, it is prepended to the resulting MIME document, effectively including it at the mail global level. It does not affect raw uploaded mails. </p> <p class="level1">You may specify any number of extra headers. Note that if you should add a custom header that has the same name as one of the internal ones curl would use, your externally set header is used instead of the internal one. This allows you to make even trickier stuff than curl would normally do. You should not replace internally set headers without knowing perfectly well what you are doing. Remove an internal header by giving a replacement without content on the right side of the colon, as in: -H "Host:". If you send the custom header with no-value then its header must be terminated with a semicolon, such as -H "X-Custom-Header;" to send "X-Custom-Header:". </p> <p class="level1">curl makes sure that each header you add/replace is sent with the proper end-of-line marker, you should thus <span Class="bold">not</span> add that as a part of the header content: do not add newlines or carriage returns, they only mess things up for you. curl passes on the verbatim string you give it without any filter or other safe guards. That includes white space and control characters. </p> <p class="level1">This option can take an argument in @filename style, which then adds a header for each line in the input file. Using @- makes curl read the header file from stdin. </p> <p class="level1">Please note that most anti-spam utilities check the presence and value of several MIME mail headers: these are "From:", "To:", "Date:" and "Subject:" among others and should be added with this option. </p> <p class="level1">You need <a class="emphasis" href="#--proxy-header">--proxy-header</a> to send custom headers intended for an HTTP proxy. </p> <p class="level1">Passing on a "Transfer-Encoding: chunked" header when doing an HTTP request with a request body, makes curl send the data using chunked encoding. </p> <p class="level1"><span Class="bold">WARNING</span>: headers set with this option are set in all HTTP requests - even after redirects are followed, like when told with <a class="emphasis" href="#-L">-L, --location</a>. This can lead to the header being sent to other hosts than the original host, so sensitive headers should be used with caution combined with following redirects. </p> <p class="level1">--header can be used several times in a command line </p> <p class="level1">Examples: </p><pre class="level1"> curl -H "X-First-Name: Joe" https://example.com curl -H "User-Agent: yes-please/2000" https://example.com curl -H "Host:" https://example.com curl -H @headers.txt https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-A">-A, --user-agent</a> and <a class="emphasis" href="#-e">-e, --referer</a>. </p> <p class="level0"><a name="-h"></a><span class="nroffip">-h, --help <subject></span> </p> <p class="level1">Usage help. Provide help for the subject given as an optional argument. </p> <p class="level1">If no argument is provided, curl displays the most important command line arguments. </p> <p class="level1">The argument can either be a <span Class="bold">category</span> or a <span Class="bold">command line option</span>. When a category is provided, curl shows all command line options within the given category. Specify category "all" to list all available options. </p> <p class="level1">If "category" is specified, curl displays all available help categories. </p> <p class="level1">If the provided subject is instead an existing command line option, specified either in its short form with a single dash and a single letter, or in the long form with two dashes and a longer name, curl displays a help text for that option in the terminal. </p> <p class="level1">The help output is extensive for some options. </p> <p class="level1">If the provided command line option is not known, curl says so. </p> <p class="level1">Examples: </p><pre class="level1"> curl --help all curl --help --insecure curl --help -f </pre> <p class="level1">See also <a class="emphasis" href="#-v">-v, --verbose</a>. </p> <p class="level0"><a name="--hostpubmd5"></a><span class="nroffip">--hostpubmd5 <md5></span> </p> <p class="level1">(SFTP SCP) Pass a string containing 32 hexadecimal digits. The string should be the 128 bit <span Class="bold">MD5</span> checksum of the remote host's public key, curl refuses the connection with the host unless the checksums match. </p> <p class="level1">If --hostpubmd5 is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --hostpubmd5 e5c1c49020640a5ab0f2034854c321a8 sftp://example.com/ </pre> <p class="level1">See also <a class="emphasis" href="#--hostpubsha256">--hostpubsha256</a>. </p> <p class="level0"><a name="--hostpubsha256"></a><span class="nroffip">--hostpubsha256 <sha256></span> </p> <p class="level1">(SFTP SCP) Pass a string containing a Base64-encoded SHA256 hash of the remote host's public key. Curl refuses the connection with the host unless the hashes match. </p> <p class="level1">This feature requires libcurl to be built with libssh2 and does not work with other SSH backends. </p> <p class="level1">If --hostpubsha256 is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --hostpubsha256 NDVkMTQxMGQ1ODdmMjQ3MjczYjAyOTY5MmRkMjVmNDQ= sftp://example.com/ </pre> <p class="level1">Added in 7.80.0. See also <a class="emphasis" href="#--hostpubmd5">--hostpubmd5</a>. </p> <p class="level0"><a name="--hsts"></a><span class="nroffip">--hsts <filename></span> </p> <p class="level1">(HTTPS) Enable HSTS for the transfer. If the filename points to an existing HSTS cache file, that is used. After a completed transfer, the cache is saved to the filename again if it has been modified. </p> <p class="level1">If curl is told to use HTTP:// for a transfer involving a hostname that exists in the HSTS cache, it upgrades the transfer to use HTTPS. Each HSTS cache entry has an individual life time after which the upgrade is no longer performed. </p> <p class="level1">Specify a "" filename (zero length) to avoid loading/saving and make curl just handle HSTS in memory. </p> <p class="level1">If this option is used several times, curl loads contents from all the files but the last one is used for saving. </p> <p class="level1">--hsts can be used several times in a command line </p> <p class="level1">Example: </p><pre class="level1"> curl --hsts cache.txt https://example.com </pre> <p class="level1">Added in 7.74.0. See also <a class="emphasis" href="#--proto">--proto</a>. </p> <p class="level0"><a name="--http09"></a><span class="nroffip">--http0.9</span> </p> <p class="level1">(HTTP) Accept an HTTP version 0.9 response. </p> <p class="level1">HTTP/0.9 is a response without headers and therefore you can also connect with this to non-HTTP servers and still get a response since curl simply transparently downgrades - if allowed. </p> <p class="level1">HTTP/0.9 is disabled by default (added in 7.66.0) </p> <p class="level1">Providing --http0.9 multiple times has no extra effect. Disable it again with --no-http0.9. </p> <p class="level1">Example: </p><pre class="level1"> curl --http0.9 https://example.com </pre> <p class="level1">Added in 7.64.0. See also <a class="emphasis" href="#--http11">--http1.1</a>, <a class="emphasis" href="#--http2">--http2</a> and <a class="emphasis" href="#--http3">--http3</a>. </p> <p class="level0"><a name="-0"></a><span class="nroffip">-0, --http1.0</span> </p> <p class="level1">(HTTP) Use HTTP version 1.0 instead of using its internally preferred HTTP version. </p> <p class="level1">Providing --http1.0 multiple times has no extra effect. </p> <p class="level1">Example: </p><pre class="level1"> curl --http1.0 https://example.com </pre> <p class="level1">This option is mutually exclusive with <a class="emphasis" href="#--http11">--http1.1</a>, <a class="emphasis" href="#--http2">--http2</a>, <a class="emphasis" href="#--http2-prior-knowledge">--http2-prior-knowledge</a> and <a class="emphasis" href="#--http3">--http3</a>. See also <a class="emphasis" href="#--http09">--http0.9</a> and <a class="emphasis" href="#--http11">--http1.1</a>. </p> <p class="level0"><a name="--http11"></a><span class="nroffip">--http1.1</span> </p> <p class="level1">(HTTP) Use HTTP version 1.1. This is the default with HTTP:// URLs. </p> <p class="level1">Providing --http1.1 multiple times has no extra effect. </p> <p class="level1">Example: </p><pre class="level1"> curl --http1.1 https://example.com </pre> <p class="level1">This option is mutually exclusive with <span Class="emphasis">--http1.0</span>, <a class="emphasis" href="#--http2">--http2</a>, <a class="emphasis" href="#--http2-prior-knowledge">--http2-prior-knowledge</a> and <a class="emphasis" href="#--http3">--http3</a>. See also <span Class="emphasis">--http1.0</span> and <a class="emphasis" href="#--http09">--http0.9</a>. </p> <p class="level0"><a name="--http2"></a><span class="nroffip">--http2</span> </p> <p class="level1">(HTTP) Use HTTP/2. </p> <p class="level1">For HTTPS, this means curl negotiates HTTP/2 in the TLS handshake. curl does this by default. </p> <p class="level1">For HTTP, this means curl attempts to upgrade the request to HTTP/2 using the Upgrade: request header. </p> <p class="level1">When curl uses HTTP/2 over HTTPS, it does not itself insist on TLS 1.2 or higher even though that is required by the specification. A user can add this version requirement with <a class="emphasis" href="#--tlsv12">--tlsv1.2</a>. </p> <p class="level1">Providing --http2 multiple times has no extra effect. </p> <p class="level1">Example: </p><pre class="level1"> curl --http2 https://example.com </pre> <p class="level1"><a class="emphasis" href="#--http2">--http2</a> requires that libcurl is built to support HTTP/2. This option is mutually exclusive with <a class="emphasis" href="#--http11">--http1.1</a>, <span Class="emphasis">--http1.0</span>, <a class="emphasis" href="#--http2-prior-knowledge">--http2-prior-knowledge</a> and <a class="emphasis" href="#--http3">--http3</a>. See also <a class="emphasis" href="#--http11">--http1.1</a>, <a class="emphasis" href="#--http3">--http3</a> and <a class="emphasis" href="#--no-alpn">--no-alpn</a>. </p> <p class="level0"><a name="--http2-prior-knowledge"></a><span class="nroffip">--http2-prior-knowledge</span> </p> <p class="level1">(HTTP) Issue a non-TLS HTTP requests using HTTP/2 directly without HTTP/1.1 Upgrade. It requires prior knowledge that the server supports HTTP/2 straight away. HTTPS requests still do HTTP/2 the standard way with negotiated protocol version in the TLS handshake. </p> <p class="level1">Since 8.10.0 if this option is set for an HTTPS request then the application layer protocol version (ALPN) offered to the server is only HTTP/2. Prior to that both HTTP/1.1 and HTTP/2 were offered. </p> <p class="level1">Providing --http2-prior-knowledge multiple times has no extra effect. Disable it again with --no-http2-prior-knowledge. </p> <p class="level1">Example: </p><pre class="level1"> curl --http2-prior-knowledge https://example.com </pre> <p class="level1"><a class="emphasis" href="#--http2-prior-knowledge">--http2-prior-knowledge</a> requires that libcurl is built to support HTTP/2. This option is mutually exclusive with <a class="emphasis" href="#--http11">--http1.1</a>, <span Class="emphasis">--http1.0</span>, <a class="emphasis" href="#--http2">--http2</a> and <a class="emphasis" href="#--http3">--http3</a>. See also <a class="emphasis" href="#--http2">--http2</a> and <a class="emphasis" href="#--http3">--http3</a>. </p> <p class="level0"><a name="--http3"></a><span class="nroffip">--http3</span> </p> <p class="level1">(HTTP) Attempt HTTP/3 to the host in the URL, but fallback to earlier HTTP versions if the HTTP/3 connection establishment fails or is slow. HTTP/3 is only available for HTTPS and not for HTTP URLs. </p> <p class="level1">This option allows a user to avoid using the Alt-Svc method of upgrading to HTTP/3 when you know or suspect that the target speaks HTTP/3 on the given host and port. </p> <p class="level1">When asked to use HTTP/3, curl issues a separate attempt to use older HTTP versions with a slight delay, so if the HTTP/3 transfer fails or is slow, curl still tries to proceed with an older HTTP version. The fallback performs the regular negotiation between HTTP/1 and HTTP/2. </p> <p class="level1">Use <a class="emphasis" href="#--http3-only">--http3-only</a> for similar functionality <span Class="emphasis">without</span> a fallback. </p> <p class="level1">Providing --http3 multiple times has no extra effect. </p> <p class="level1">Example: </p><pre class="level1"> curl --http3 https://example.com </pre> <p class="level1"><a class="emphasis" href="#--http3">--http3</a> requires that libcurl is built to support HTTP/3. This option is mutually exclusive with <a class="emphasis" href="#--http11">--http1.1</a>, <span Class="emphasis">--http1.0</span>, <a class="emphasis" href="#--http2">--http2</a>, <a class="emphasis" href="#--http2-prior-knowledge">--http2-prior-knowledge</a> and <a class="emphasis" href="#--http3-only">--http3-only</a>. Added in 7.66.0. See also <a class="emphasis" href="#--http11">--http1.1</a> and <a class="emphasis" href="#--http2">--http2</a>. </p> <p class="level0"><a name="--http3-only"></a><span class="nroffip">--http3-only</span> </p> <p class="level1">(HTTP) Instructs curl to use HTTP/3 to the host in the URL, with no fallback to earlier HTTP versions. HTTP/3 can only be used for HTTPS and not for HTTP URLs. For HTTP, this option triggers an error. </p> <p class="level1">This option allows a user to avoid using the Alt-Svc method of upgrading to HTTP/3 when you know that the target speaks HTTP/3 on the given host and port. </p> <p class="level1">This option makes curl fail if a QUIC connection cannot be established, it does not attempt any other HTTP versions on its own. Use <a class="emphasis" href="#--http3">--http3</a> for similar functionality <span Class="emphasis">with</span> a fallback. </p> <p class="level1">Providing --http3-only multiple times has no extra effect. </p> <p class="level1">Example: </p><pre class="level1"> curl --http3-only https://example.com </pre> <p class="level1"><a class="emphasis" href="#--http3-only">--http3-only</a> requires that libcurl is built to support HTTP/3. This option is mutually exclusive with <a class="emphasis" href="#--http11">--http1.1</a>, <span Class="emphasis">--http1.0</span>, <a class="emphasis" href="#--http2">--http2</a>, <a class="emphasis" href="#--http2-prior-knowledge">--http2-prior-knowledge</a> and <a class="emphasis" href="#--http3">--http3</a>. Added in 7.88.0. See also <a class="emphasis" href="#--http11">--http1.1</a>, <a class="emphasis" href="#--http2">--http2</a> and <a class="emphasis" href="#--http3">--http3</a>. </p> <p class="level0"><a name="--ignore-content-length"></a><span class="nroffip">--ignore-content-length</span> </p> <p class="level1">(FTP HTTP) For HTTP, Ignore the Content-Length header. This is particularly useful for servers running Apache 1.x, which reports incorrect Content-Length for files larger than 2 gigabytes. </p> <p class="level1">For FTP, this makes curl skip the SIZE command to figure out the size before downloading a file. </p> <p class="level1">This option does not work for HTTP if libcurl was built to use hyper. </p> <p class="level1">Providing --ignore-content-length multiple times has no extra effect. Disable it again with --no-ignore-content-length. </p> <p class="level1">Example: </p><pre class="level1"> curl --ignore-content-length https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--ftp-skip-pasv-ip">--ftp-skip-pasv-ip</a>. </p> <p class="level0"><a name="-k"></a><span class="nroffip">-k, --insecure</span> </p> <p class="level1">(TLS SFTP SCP) By default, every secure connection curl makes is verified to be secure before the transfer takes place. This option makes curl skip the verification step and proceed without checking. </p> <p class="level1">When this option is not used for protocols using TLS, curl verifies the server's TLS certificate before it continues: that the certificate contains the right name which matches the hostname used in the URL and that the certificate has been signed by a CA certificate present in the cert store. See this online resource for further details: <span Class="bold"><a href="https://curl.se/docs/sslcerts.html">https://curl.se/docs/sslcerts.html</a></span> </p> <p class="level1">For SFTP and SCP, this option makes curl skip the <span Class="emphasis">known_hosts</span> verification. <span Class="emphasis">known_hosts</span> is a file normally stored in the user's home directory in the ".ssh" subdirectory, which contains hostnames and their public keys. </p> <p class="level1"><span Class="bold">WARNING</span>: using this option makes the transfer insecure. </p> <p class="level1">When curl uses secure protocols it trusts responses and allows for example HSTS and Alt-Svc information to be stored and used subsequently. Using <a class="emphasis" href="#-k">-k, --insecure</a> can make curl trust and use such information from malicious servers. </p> <p class="level1">Providing --insecure multiple times has no extra effect. Disable it again with --no-insecure. </p> <p class="level1">Example: </p><pre class="level1"> curl --insecure https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--proxy-insecure">--proxy-insecure</a>, <a class="emphasis" href="#--cacert">--cacert</a> and <a class="emphasis" href="#--capath">--capath</a>. </p> <p class="level0"><a name="--interface"></a><span class="nroffip">--interface <name></span> </p> <p class="level1">Perform the operation using a specified interface. You can enter interface name, IP address or hostname. If you prefer to be specific, you can use the following special syntax: </p> <p class="level1"><a name="ifname"></a><span class="nroffip">if!<name></span> </p> <p class="level2">Interface name. If the provided name does not match an existing interface, curl returns with error 45. </p> <p class="level1"><a name="hostname"></a><span class="nroffip">host!<name></span> </p> <p class="level2">IP address or hostname. </p> <p class="level1"><a name="ifhostinterfacehost"></a><span class="nroffip">ifhost!<interface>!<host></span> </p> <p class="level2">Interface name and IP address or hostname. This syntax requires libcurl 8.9.0 or later. </p> <p class="level2">If the provided name does not match an existing interface, curl returns with error 45. </p> <p class="level0"><a name=""></a><span class="nroffip"></span> </p> <p class="level1">curl does not support using network interface names for this option on Windows. </p> <p class="level1">That name resolve operation if a hostname is provided does <span Class="bold">not</span> use DNS-over-HTTPS even if <a class="emphasis" href="#--doh-url">--doh-url</a> is set. </p> <p class="level1">On Linux this option can be used to specify a <span Class="bold">VRF</span> (Virtual Routing and Forwarding) device, but the binary then needs to either have the <span Class="bold">CAP_NET_RAW</span> capability set or to be run as root. </p> <p class="level1">If --interface is provided several times, the last set value is used. </p> <p class="level1">Examples: </p><pre class="level1"> curl --interface eth0 https://example.com curl --interface "host!10.0.0.1" https://example.com curl --interface "if!enp3s0" https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--dns-interface">--dns-interface</a>. </p> <p class="level0"><a name="--ip-tos"></a><span class="nroffip">--ip-tos <string></span> </p> <p class="level1">(All) Set Type of Service (TOS) for IPv4 or Traffic Class for IPv6. </p> <p class="level1">The values allowed for <string> can be a numeric value between 1 and 255 or one of the following: </p> <p class="level1">CS0, CS1, CS2, CS3, CS4, CS5, CS6, CS7, AF11, AF12, AF13, AF21, AF22, AF23, AF31, AF32, AF33, AF41, AF42, AF43, EF, VOICE-ADMIT, ECT1, ECT0, CE, LE, LOWCOST, LOWDELAY, THROUGHPUT, RELIABILITY, MINCOST </p> <p class="level1">If --ip-tos is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --ip-tos CS5 https://example.com </pre> <p class="level1">Added in 8.9.0. See also <a class="emphasis" href="#--tcp-nodelay">--tcp-nodelay</a> and <a class="emphasis" href="#--vlan-priority">--vlan-priority</a>. </p> <p class="level0"><a name="--ipfs-gateway"></a><span class="nroffip">--ipfs-gateway <URL></span> </p> <p class="level1">(IPFS) Specify which gateway to use for IPFS and IPNS URLs. Not specifying this instead makes curl check if the IPFS_GATEWAY environment variable is set, or if a "~/.ipfs/gateway" file holding the gateway URL exists. </p> <p class="level1">If you run a local IPFS node, this gateway is by default available under "<a href="http://localhost:8080".">http://localhost:8080".</a> A full example URL would look like: </p><pre class="level1"> curl --ipfs-gateway http://localhost:8080 \ ipfs://bafybeigagd5nmnn2iys2f3 </pre> <p class="level1">There are many public IPFS gateways. See for example: <a href="https://ipfs.github.io/public-gateway-checker/">https://ipfs.github.io/public-gateway-checker/</a> </p> <p class="level1">If you opt to go for a remote gateway you need to be aware that you completely trust the gateway. This might be fine in local gateways that you host yourself. With remote gateways there could potentially be malicious actors returning you data that does not match the request you made, inspect or even interfere with the request. You may not notice this when using curl. A mitigation could be to go for a "trustless" gateway. This means you locally verify that the data. Consult the docs page on trusted vs trustless: <a href="https://docs.ipfs.tech/reference/http/gateway/#trusted-vs-trustless">https://docs.ipfs.tech/reference/http/gateway/#trusted-vs-trustless</a> </p> <p class="level1">If --ipfs-gateway is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --ipfs-gateway https://example.com ipfs:// </pre> <p class="level1">Added in 8.4.0. See also <a class="emphasis" href="#-h">-h, --help</a> and <a class="emphasis" href="#-M">-M, --manual</a>. </p> <p class="level0"><a name="-4"></a><span class="nroffip">-4, --ipv4</span> </p> <p class="level1">Use IPv4 addresses only when resolving hostnames, and not for example try IPv6. </p> <p class="level1">Providing --ipv4 multiple times has no extra effect. </p> <p class="level1">Example: </p><pre class="level1"> curl --ipv4 https://example.com </pre> <p class="level1">This option is mutually exclusive with <a class="emphasis" href="#-6">-6, --ipv6</a>. See also <a class="emphasis" href="#--http11">--http1.1</a> and <a class="emphasis" href="#--http2">--http2</a>. </p> <p class="level0"><a name="-6"></a><span class="nroffip">-6, --ipv6</span> </p> <p class="level1">Use IPv6 addresses only when resolving hostnames, and not for example try IPv4. </p> <p class="level1">Your resolver may respond to an IPv6-only resolve request by returning IPv6 addresses that contain "mapped" IPv4 addresses for compatibility purposes. macOS is known to do this. </p> <p class="level1">Providing --ipv6 multiple times has no extra effect. </p> <p class="level1">Example: </p><pre class="level1"> curl --ipv6 https://example.com </pre> <p class="level1">This option is mutually exclusive with <a class="emphasis" href="#-4">-4, --ipv4</a>. See also <a class="emphasis" href="#--http11">--http1.1</a> and <a class="emphasis" href="#--http2">--http2</a>. </p> <p class="level0"><a name="--json"></a><span class="nroffip">--json <data></span> </p> <p class="level1">(HTTP) Sends the specified JSON data in a POST request to the HTTP server. <a class="emphasis" href="#--json">--json</a> works as a shortcut for passing on these three options: </p><pre class="level1"> --data-binary [arg] --header "Content-Type: application/json" --header "Accept: application/json" </pre> <p class="level1">There is <span Class="bold">no verification</span> that the passed in data is actual JSON or that the syntax is correct. </p> <p class="level1">If you start the data with the letter @, the rest should be a filename to read the data from, or a single dash (-) if you want curl to read the data from stdin. Posting data from a file named 'foobar' would thus be done with <a class="emphasis" href="#--json">--json</a> @foobar and to instead read the data from stdin, use <a class="emphasis" href="#--json">--json</a> @-. </p> <p class="level1">If this option is used more than once on the same command line, the additional data pieces are concatenated to the previous before sending. </p> <p class="level1">The headers this option sets can be overridden with <a class="emphasis" href="#-H">-H, --header</a> as usual. </p> <p class="level1">--json can be used several times in a command line </p> <p class="level1">Examples: </p><pre class="level1"> curl --json '{ "drink": "coffe" }' https://example.com curl --json '{ "drink":' --json ' "coffe" }' https://example.com curl --json @prepared https://example.com curl --json @- https://example.com < json.txt </pre> <p class="level1">This option is mutually exclusive with <a class="emphasis" href="#-F">-F, --form</a>, <a class="emphasis" href="#-I">-I, --head</a> and <a class="emphasis" href="#-T">-T, --upload-file</a>. Added in 7.82.0. See also <a class="emphasis" href="#--data-binary">--data-binary</a> and <a class="emphasis" href="#--data-raw">--data-raw</a>. </p> <p class="level0"><a name="-j"></a><span class="nroffip">-j, --junk-session-cookies</span> </p> <p class="level1">(HTTP) When curl is told to read cookies from a given file, this option makes it discard all "session cookies". This has the same effect as if a new session is started. Typical browsers discard session cookies when they are closed down. </p> <p class="level1">Providing --junk-session-cookies multiple times has no extra effect. Disable it again with --no-junk-session-cookies. </p> <p class="level1">Example: </p><pre class="level1"> curl --junk-session-cookies -b cookies.txt https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-b">-b, --cookie</a> and <a class="emphasis" href="#-c">-c, --cookie-jar</a>. </p> <p class="level0"><a name="--keepalive-cnt"></a><span class="nroffip">--keepalive-cnt <integer></span> </p> <p class="level1">Set the maximum number of keepalive probes TCP should send but get no response before dropping the connection. This option is usually used in conjunction with <a class="emphasis" href="#--keepalive-time">--keepalive-time</a>. </p> <p class="level1">This option is supported on Linux, *BSD/macOS, Windows >=10.0.16299, Solaris 11.4, and recent AIX, HP-UX and more. This option has no effect if <a class="emphasis" href="#--no-keepalive">--no-keepalive</a> is used. </p> <p class="level1">If unspecified, the option defaults to 9. </p> <p class="level1">If --keepalive-cnt is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --keepalive-cnt 3 https://example.com </pre> <p class="level1">Added in 8.9.0. See also <a class="emphasis" href="#--keepalive-time">--keepalive-time</a> and <a class="emphasis" href="#--no-keepalive">--no-keepalive</a>. </p> <p class="level0"><a name="--keepalive-time"></a><span class="nroffip">--keepalive-time <seconds></span> </p> <p class="level1">Set the time a connection needs to remain idle before sending keepalive probes and the time between individual keepalive probes. It is currently effective on operating systems offering the "TCP_KEEPIDLE" and "TCP_KEEPINTVL" socket options (meaning Linux, *BSD/macOS, Windows, Solaris, and recent AIX, HP-UX and more). Keepalive is used by the TCP stack to detect broken networks on idle connections. The number of missed keepalive probes before declaring the connection down is OS dependent and is commonly 8 (*BSD/macOS/AIX), 9 (Linux/AIX) or 5/10 (Windows), and this number can be changed by specifying the curl option "keepalive-cnt". Note that this option has no effect if <a class="emphasis" href="#--no-keepalive">--no-keepalive</a> is used. </p> <p class="level1">If unspecified, the option defaults to 60 seconds. </p> <p class="level1">If --keepalive-time is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --keepalive-time 20 https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--no-keepalive">--no-keepalive</a>, <a class="emphasis" href="#--keepalive-cnt">--keepalive-cnt</a> and <a class="emphasis" href="#-m">-m, --max-time</a>. </p> <p class="level0"><a name="--key"></a><span class="nroffip">--key <key></span> </p> <p class="level1">(TLS SSH) Private key filename. Allows you to provide your private key in this separate file. For SSH, if not specified, curl tries the following candidates in order: "~/.ssh/id_rsa", "~/.ssh/id_dsa", "./id_rsa", "./id_dsa". </p> <p class="level1">If curl is built against OpenSSL library, and the engine pkcs11 is available, then a PKCS#11 URI (<a href="https://www.ietf.org/rfc/rfc7512.txt">RFC 7512</a>) can be used to specify a private key located in a PKCS#11 device. A string beginning with "pkcs11:" is interpreted as a PKCS#11 URI. If a PKCS#11 URI is provided, then the <a class="emphasis" href="#--engine">--engine</a> option is set as "pkcs11" if none was provided and the <a class="emphasis" href="#--key-type">--key-type</a> option is set as "ENG" if none was provided. </p> <p class="level1">If curl is built against Secure Transport or Schannel then this option is ignored for TLS protocols (HTTPS, etc). Those backends expect the private key to be already present in the keychain or PKCS#12 file containing the certificate. </p> <p class="level1">If --key is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --cert certificate --key here https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--key-type">--key-type</a> and <a class="emphasis" href="#-E">-E, --cert</a>. </p> <p class="level0"><a name="--key-type"></a><span class="nroffip">--key-type <type></span> </p> <p class="level1">(TLS) Private key file type. Specify which type your <a class="emphasis" href="#--key">--key</a> provided private key is. DER, PEM, and ENG are supported. If not specified, PEM is assumed. </p> <p class="level1">If --key-type is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --key-type DER --key here https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--key">--key</a>. </p> <p class="level0"><a name="--krb"></a><span class="nroffip">--krb <level></span> </p> <p class="level1">(FTP) Enable Kerberos authentication and use. The level must be entered and should be one of 'clear', 'safe', 'confidential', or 'private'. Should you use a level that is not one of these, 'private' is used. </p> <p class="level1">If --krb is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --krb clear ftp://example.com/ </pre> <p class="level1"><a class="emphasis" href="#--krb">--krb</a> requires that libcurl is built to support Kerberos. See also <a class="emphasis" href="#--delegation">--delegation</a> and <a class="emphasis" href="#--ssl">--ssl</a>. </p> <p class="level0"><a name="--libcurl"></a><span class="nroffip">--libcurl <file></span> </p> <p class="level1">Append this option to any ordinary curl command line, and you get libcurl-using C source code written to the file that does the equivalent of what your command-line operation does. </p> <p class="level1">This option is global and does not need to be specified for each use of --next. </p> <p class="level1">If --libcurl is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --libcurl client.c https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-v">-v, --verbose</a>. </p> <p class="level0"><a name="--limit-rate"></a><span class="nroffip">--limit-rate <speed></span> </p> <p class="level1">Specify the maximum transfer rate you want curl to use - for both downloads and uploads. This feature is useful if you have a limited pipe and you would like your transfer not to use your entire bandwidth. To make it slower than it otherwise would be. </p> <p class="level1">The given speed is measured in bytes/second, unless a suffix is appended. Appending 'k' or 'K' counts the number as kilobytes, 'm' or 'M' makes it megabytes, while 'g' or 'G' makes it gigabytes. The suffixes (k, M, G, T, P) are 1024 based. For example 1k is 1024. Examples: 200K, 3m and 1G. </p> <p class="level1">The rate limiting logic works on averaging the transfer speed to no more than the set threshold over a period of multiple seconds. </p> <p class="level1">If you also use the <a class="emphasis" href="#-Y">-Y, --speed-limit</a> option, that option takes precedence and might cripple the rate-limiting slightly, to help keeping the speed-limit logic working. </p> <p class="level1">If --limit-rate is provided several times, the last set value is used. </p> <p class="level1">Examples: </p><pre class="level1"> curl --limit-rate 100K https://example.com curl --limit-rate 1000 https://example.com curl --limit-rate 10M https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--rate">--rate</a>, <a class="emphasis" href="#-Y">-Y, --speed-limit</a> and <a class="emphasis" href="#-y">-y, --speed-time</a>. </p> <p class="level0"><a name="-l"></a><span class="nroffip">-l, --list-only</span> </p> <p class="level1">(FTP POP3 SFTP FILE) When listing an FTP directory, force a name-only view. Maybe particularly useful if the user wants to machine-parse the contents of an FTP directory since the normal directory view does not use a standard look or format. When used like this, the option causes an NLST command to be sent to the server instead of LIST. </p> <p class="level1">Note: Some FTP servers list only files in their response to NLST; they do not include sub-directories and symbolic links. </p> <p class="level1">When listing an SFTP directory, this switch forces a name-only view, one per line. This is especially useful if the user wants to machine-parse the contents of an SFTP directory since the normal directory view provides more information than just filenames. </p> <p class="level1">When retrieving a specific email from POP3, this switch forces a LIST command to be performed instead of RETR. This is particularly useful if the user wants to see if a specific message-id exists on the server and what size it is. </p> <p class="level1">For FILE, this option has no effect yet as directories are always listed in this mode. </p> <p class="level1">Note: When combined with <a class="emphasis" href="#-X">-X, --request</a>, this option can be used to send a UIDL command instead, so the user may use the email's unique identifier rather than its message-id to make the request. </p> <p class="level1">Providing --list-only multiple times has no extra effect. Disable it again with --no-list-only. </p> <p class="level1">Example: </p><pre class="level1"> curl --list-only ftp://example.com/dir/ </pre> <p class="level1">See also <a class="emphasis" href="#-Q">-Q, --quote</a> and <a class="emphasis" href="#-X">-X, --request</a>. </p> <p class="level0"><a name="--local-port"></a><span class="nroffip">--local-port <range></span> </p> <p class="level1">Set a preferred single number or range (FROM-TO) of local port numbers to use for the connection(s). Note that port numbers by nature are a scarce resource so setting this range to something too narrow might cause unnecessary connection setup failures. </p> <p class="level1">If --local-port is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --local-port 1000-3000 https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-g">-g, --globoff</a>. </p> <p class="level0"><a name="-L"></a><span class="nroffip">-L, --location</span> </p> <p class="level1">(HTTP) If the server reports that the requested page has moved to a different location (indicated with a Location: header and a 3XX response code), this option makes curl redo the request on the new place. If used together with <a class="emphasis" href="#-i">-i, --show-headers</a> or <a class="emphasis" href="#-I">-I, --head</a>, headers from all requested pages are shown. </p> <p class="level1">When authentication is used, or send cookie with "-H Cookie:", curl only sends its credentials to the initial host. If a redirect takes curl to a different host, it does not get the credentials pass on. See <a class="emphasis" href="#--location-trusted">--location-trusted</a> on how to change this. </p> <p class="level1">Limit the amount of redirects to follow by using the <a class="emphasis" href="#--max-redirs">--max-redirs</a> option. </p> <p class="level1">When curl follows a redirect and if the request is a POST, it sends the following request with a GET if the HTTP response was 301, 302, or 303. If the response code was any other 3xx code, curl resends the following request using the same unmodified method. </p> <p class="level1">You can tell curl to not change POST requests to GET after a 30x response by using the dedicated options for that: <a class="emphasis" href="#--post301">--post301</a>, <a class="emphasis" href="#--post302">--post302</a> and <a class="emphasis" href="#--post303">--post303</a>. </p> <p class="level1">The method set with <a class="emphasis" href="#-X">-X, --request</a> overrides the method curl would otherwise select to use. </p> <p class="level1">Providing --location multiple times has no extra effect. Disable it again with --no-location. </p> <p class="level1">Example: </p><pre class="level1"> curl -L https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--resolve">--resolve</a> and <a class="emphasis" href="#--alt-svc">--alt-svc</a>. </p> <p class="level0"><a name="--location-trusted"></a><span class="nroffip">--location-trusted</span> </p> <p class="level1">(HTTP) Instructs curl to like <a class="emphasis" href="#-L">-L, --location</a> follow HTTP redirects, but permits it to send credentials and other secrets along to other hosts than the initial one. </p> <p class="level1">This may or may not introduce a security breach if the site redirects you to a site to which you send this sensitive data to. Another host means that one or more of hostname, protocol scheme or port number changed. </p> <p class="level1">This option also allows curl to pass long cookies set explicitly with <a class="emphasis" href="#-H">-H, --header</a>. </p> <p class="level1">Providing --location-trusted multiple times has no extra effect. Disable it again with --no-location-trusted. </p> <p class="level1">Examples: </p><pre class="level1"> curl --location-trusted -u user:password https://example.com curl --location-trusted -H "Cookie: session=abc" https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-u">-u, --user</a>. </p> <p class="level0"><a name="--login-options"></a><span class="nroffip">--login-options <options></span> </p> <p class="level1">(IMAP LDAP POP3 SMTP) Specify the login options to use during server authentication. </p> <p class="level1">You can use login options to specify protocol specific options that may be used during authentication. At present only IMAP, POP3 and SMTP support login options. For more information about login options please see <a href="https://www.ietf.org/rfc/rfc2384.txt">RFC 2384</a>, <a href="https://www.ietf.org/rfc/rfc5092.txt">RFC 5092</a> and the IETF draft <a href="https://datatracker.ietf.org/doc/html/draft-earhart-url-smtp-00">https://datatracker.ietf.org/doc/html/draft-earhart-url-smtp-00</a> </p> <p class="level1">Since 8.2.0, IMAP supports the login option "AUTH=+LOGIN". With this option, curl uses the plain (not SASL) "LOGIN IMAP" command even if the server advertises SASL authentication. Care should be taken in using this option, as it sends your password over the network in plain text. This does not work if the IMAP server disables the plain "LOGIN" (e.g. to prevent password snooping). </p> <p class="level1">If --login-options is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --login-options 'AUTH=*' imap://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-u">-u, --user</a>. </p> <p class="level0"><a name="--mail-auth"></a><span class="nroffip">--mail-auth <address></span> </p> <p class="level1">(SMTP) Specify a single address. This is used to specify the authentication address (identity) of a submitted message that is being relayed to another server. </p> <p class="level1">If --mail-auth is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --mail-auth user@example.com -T mail smtp://example.com/ </pre> <p class="level1">See also <a class="emphasis" href="#--mail-rcpt">--mail-rcpt</a> and <a class="emphasis" href="#--mail-from">--mail-from</a>. </p> <p class="level0"><a name="--mail-from"></a><span class="nroffip">--mail-from <address></span> </p> <p class="level1">(SMTP) Specify a single address that the given mail should get sent from. </p> <p class="level1">If --mail-from is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --mail-from user@example.com -T mail smtp://example.com/ </pre> <p class="level1">See also <a class="emphasis" href="#--mail-rcpt">--mail-rcpt</a> and <a class="emphasis" href="#--mail-auth">--mail-auth</a>. </p> <p class="level0"><a name="--mail-rcpt"></a><span class="nroffip">--mail-rcpt <address></span> </p> <p class="level1">(SMTP) Specify a single email address, username or mailing list name. Repeat this option several times to send to multiple recipients. </p> <p class="level1">When performing an address verification (<span Class="bold">VRFY</span> command), the recipient should be specified as the username or username and domain (as per Section 3.5 of <a href="https://www.ietf.org/rfc/rfc5321.txt">RFC 5321</a>). </p> <p class="level1">When performing a mailing list expand (EXPN command), the recipient should be specified using the mailing list name, such as "Friends" or "London-Office". </p> <p class="level1">--mail-rcpt can be used several times in a command line </p> <p class="level1">Example: </p><pre class="level1"> curl --mail-rcpt user@example.net smtp://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--mail-rcpt-allowfails">--mail-rcpt-allowfails</a>. </p> <p class="level0"><a name="--mail-rcpt-allowfails"></a><span class="nroffip">--mail-rcpt-allowfails</span> </p> <p class="level1">(SMTP) When sending data to multiple recipients, by default curl aborts SMTP conversation if at least one of the recipients causes RCPT TO command to return an error. </p> <p class="level1">The default behavior can be changed by passing <a class="emphasis" href="#--mail-rcpt-allowfails">--mail-rcpt-allowfails</a> command-line option which makes curl ignore errors and proceed with the remaining valid recipients. </p> <p class="level1">If all recipients trigger RCPT TO failures and this flag is specified, curl still aborts the SMTP conversation and returns the error received from to the last RCPT TO command. </p> <p class="level1">Providing --mail-rcpt-allowfails multiple times has no extra effect. Disable it again with --no-mail-rcpt-allowfails. </p> <p class="level1">Example: </p><pre class="level1"> curl --mail-rcpt-allowfails --mail-rcpt dest@example.com smtp://example.com </pre> <p class="level1">Added in 7.69.0. See also <a class="emphasis" href="#--mail-rcpt">--mail-rcpt</a>. </p> <p class="level0"><a name="-M"></a><span class="nroffip">-M, --manual</span> </p> <p class="level1">Manual. Display the huge help text. </p> <p class="level1">Example: </p><pre class="level1"> curl --manual </pre> <p class="level1">See also <a class="emphasis" href="#-v">-v, --verbose</a>, <a class="emphasis" href="#--libcurl">--libcurl</a> and <a class="emphasis" href="#--trace">--trace</a>. </p> <p class="level0"><a name="--max-filesize"></a><span class="nroffip">--max-filesize <bytes></span> </p> <p class="level1">(FTP HTTP MQTT) When set to a non-zero value, it specifies the maximum size (in bytes) of a file to download. If the file requested is larger than this value, the transfer does not start and curl returns with exit code 63. </p> <p class="level1">Setting the maximum value to zero disables the limit. </p> <p class="level1">A size modifier may be used. For example, Appending 'k' or 'K' counts the number as kilobytes, 'm' or 'M' makes it megabytes, while 'g' or 'G' makes it gigabytes. Examples: 200K, 3m and 1G. </p> <p class="level1"><span Class="bold">NOTE</span>: before curl 8.4.0, when the file size is not known prior to download, for such files this option has no effect even if the file transfer ends up being larger than this given limit. </p> <p class="level1">Starting with curl 8.4.0, this option aborts the transfer if it reaches the threshold during transfer. </p> <p class="level1">If --max-filesize is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --max-filesize 100K https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--limit-rate">--limit-rate</a>. </p> <p class="level0"><a name="--max-redirs"></a><span class="nroffip">--max-redirs <num></span> </p> <p class="level1">(HTTP) Set maximum number of redirections to follow. When <a class="emphasis" href="#-L">-L, --location</a> is used, to prevent curl from following too many redirects, by default, the limit is set to 50 redirects. Set this option to -1 to make it unlimited. </p> <p class="level1">If --max-redirs is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --max-redirs 3 --location https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-L">-L, --location</a>. </p> <p class="level0"><a name="-m"></a><span class="nroffip">-m, --max-time <seconds></span> </p> <p class="level1">Set maximum time in seconds that you allow each transfer to take. Prevents your batch jobs from hanging for hours due to slow networks or links going down. This option accepts decimal values. </p> <p class="level1">If you enable retrying the transfer (<a class="emphasis" href="#--retry">--retry</a>) then the maximum time counter is reset each time the transfer is retried. You can use <a class="emphasis" href="#--retry-max-time">--retry-max-time</a> to limit the retry time. </p> <p class="level1">The decimal value needs to be provided using a dot (.) as decimal separator - not the local version even if it might be using another separator. </p> <p class="level1">If --max-time is provided several times, the last set value is used. </p> <p class="level1">Examples: </p><pre class="level1"> curl --max-time 10 https://example.com curl --max-time 2.92 https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--connect-timeout">--connect-timeout</a> and <a class="emphasis" href="#--retry-max-time">--retry-max-time</a>. </p> <p class="level0"><a name="--metalink"></a><span class="nroffip">--metalink</span> </p> <p class="level1">This option was previously used to specify a Metalink resource. Metalink support is disabled in curl for security reasons (added in 7.78.0). </p> <p class="level1">If --metalink is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --metalink file https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-Z">-Z, --parallel</a>. </p> <p class="level0"><a name="--mptcp"></a><span class="nroffip">--mptcp</span> </p> <p class="level1">Enables the use of Multipath TCP (MPTCP) for connections. MPTCP is an extension to the standard TCP that allows multiple TCP streams over different network paths between the same source and destination. This can enhance bandwidth and improve reliability by using multiple paths simultaneously. </p> <p class="level1">MPTCP is beneficial in networks where multiple paths exist between clients and servers, such as mobile networks where a device may switch between WiFi and cellular data or in wired networks with multiple Internet Service Providers. </p> <p class="level1">This option is currently only supported on Linux starting from kernel 5.6. Only TCP connections are modified, hence this option does not effect HTTP/3 (QUIC) or UDP connections. </p> <p class="level1">The server curl connects to must also support MPTCP. If not, the connection seamlessly falls back to TCP. </p> <p class="level1">Providing --mptcp multiple times has no extra effect. Disable it again with --no-mptcp. </p> <p class="level1">Example: </p><pre class="level1"> curl --mptcp https://example.com </pre> <p class="level1">Added in 8.9.0. See also <a class="emphasis" href="#--tcp-fastopen">--tcp-fastopen</a>. </p> <p class="level0"><a name="--negotiate"></a><span class="nroffip">--negotiate</span> </p> <p class="level1">(HTTP) Enable Negotiate (SPNEGO) authentication. </p> <p class="level1">This option requires a library built with GSS-API or SSPI support. Use <a class="emphasis" href="#-V">-V, --version</a> to see if your curl supports GSS-API/SSPI or SPNEGO. </p> <p class="level1">When using this option, you must also provide a fake <a class="emphasis" href="#-u">-u, --user</a> option to activate the authentication code properly. Sending a '-u :' is enough as the username and password from the <a class="emphasis" href="#-u">-u, --user</a> option are not actually used. </p> <p class="level1">Providing --negotiate multiple times has no extra effect. </p> <p class="level1">Example: </p><pre class="level1"> curl --negotiate -u : https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--basic">--basic</a>, <a class="emphasis" href="#--ntlm">--ntlm</a>, <a class="emphasis" href="#--anyauth">--anyauth</a> and <a class="emphasis" href="#--proxy-negotiate">--proxy-negotiate</a>. </p> <p class="level0"><a name="-n"></a><span class="nroffip">-n, --netrc</span> </p> <p class="level1">Make curl scan the <span Class="emphasis">.netrc</span> file in the user's home directory for login name and password. This is typically used for FTP on Unix. If used with HTTP, curl enables user authentication. See <span Class="emphasis">netrc(5)</span> and <span Class="emphasis">ftp(1)</span> for details on the file format. Curl does not complain if that file does not have the right permissions (it should be neither world- nor group-readable). The environment variable "HOME" is used to find the home directory. </p> <p class="level1">On Windows two filenames in the home directory are checked: <span Class="emphasis">.netrc</span> and <span Class="emphasis">_netrc</span>, preferring the former. Older versions on Windows checked for <span Class="emphasis">_netrc</span> only. </p> <p class="level1">A quick and simple example of how to setup a <span Class="emphasis">.netrc</span> to allow curl to FTP to the machine host.domain.com with username 'myself' and password 'secret' could look similar to: </p><pre class="level1"> machine host.domain.com login myself password secret </pre> <p class="level1">Providing --netrc multiple times has no extra effect. Disable it again with --no-netrc. </p> <p class="level1">Example: </p><pre class="level1"> curl --netrc https://example.com </pre> <p class="level1">This option is mutually exclusive with <a class="emphasis" href="#--netrc-file">--netrc-file</a> and <a class="emphasis" href="#--netrc-optional">--netrc-optional</a>. See also <a class="emphasis" href="#--netrc-file">--netrc-file</a>, <a class="emphasis" href="#-K">-K, --config</a> and <a class="emphasis" href="#-u">-u, --user</a>. </p> <p class="level0"><a name="--netrc-file"></a><span class="nroffip">--netrc-file <filename></span> </p> <p class="level1">Set the netrc file to use. Similar to <a class="emphasis" href="#-n">-n, --netrc</a>, except that you also provide the path (absolute or relative). </p> <p class="level1">It abides by <a class="emphasis" href="#--netrc-optional">--netrc-optional</a> if specified. </p> <p class="level1">If --netrc-file is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --netrc-file netrc https://example.com </pre> <p class="level1">This option is mutually exclusive with <a class="emphasis" href="#-n">-n, --netrc</a>. See also <a class="emphasis" href="#-n">-n, --netrc</a>, <a class="emphasis" href="#-u">-u, --user</a> and <a class="emphasis" href="#-K">-K, --config</a>. </p> <p class="level0"><a name="--netrc-optional"></a><span class="nroffip">--netrc-optional</span> </p> <p class="level1">Similar to <a class="emphasis" href="#-n">-n, --netrc</a>, but this option makes the .netrc usage <span Class="bold">optional</span> and not mandatory as the <a class="emphasis" href="#-n">-n, --netrc</a> option does. </p> <p class="level1">Providing --netrc-optional multiple times has no extra effect. Disable it again with --no-netrc-optional. </p> <p class="level1">Example: </p><pre class="level1"> curl --netrc-optional https://example.com </pre> <p class="level1">This option is mutually exclusive with <a class="emphasis" href="#-n">-n, --netrc</a>. See also <a class="emphasis" href="#--netrc-file">--netrc-file</a>. </p> <p class="level0"><a name="-"></a><span class="nroffip">-:, --next</span> </p> <p class="level1">Use a separate operation for the following URL and associated options. This allows you to send several URL requests, each with their own specific options, for example, such as different usernames or custom requests for each. </p> <p class="level1"><a class="emphasis" href="#-">-:, --next</a> resets all local options and only global ones have their values survive over to the operation following the <a class="emphasis" href="#-">-:, --next</a> instruction. Global options include <a class="emphasis" href="#-v">-v, --verbose</a>, <a class="emphasis" href="#--trace">--trace</a>, <a class="emphasis" href="#--trace-ascii">--trace-ascii</a> and <a class="emphasis" href="#--fail-early">--fail-early</a>. </p> <p class="level1">For example, you can do both a GET and a POST in a single command line: </p><pre class="level1"> curl www1.example.com --next -d postthis www2.example.com </pre> <p class="level1">--next can be used several times in a command line </p> <p class="level1">Examples: </p><pre class="level1"> curl https://example.com --next -d postthis www2.example.com curl -I https://example.com --next https://example.net/ </pre> <p class="level1">See also <a class="emphasis" href="#-Z">-Z, --parallel</a> and <a class="emphasis" href="#-K">-K, --config</a>. </p> <p class="level0"><a name="--no-alpn"></a><span class="nroffip">--no-alpn</span> </p> <p class="level1">(HTTPS) Disable the ALPN TLS extension. ALPN is enabled by default if libcurl was built with an SSL library that supports ALPN. ALPN is used by a libcurl that supports HTTP/2 to negotiate HTTP/2 support with the server during https sessions. </p> <p class="level1">Note that this is the negated option name documented. You can use <span Class="emphasis">--alpn</span> to enable ALPN. </p> <p class="level1">Providing --no-alpn multiple times has no extra effect. Disable it again with --alpn. </p> <p class="level1">Example: </p><pre class="level1"> curl --no-alpn https://example.com </pre> <p class="level1"><a class="emphasis" href="#--no-alpn">--no-alpn</a> requires that libcurl is built to support TLS. See also <a class="emphasis" href="#--no-npn">--no-npn</a> and <a class="emphasis" href="#--http2">--http2</a>. </p> <p class="level0"><a name="-N"></a><span class="nroffip">-N, --no-buffer</span> </p> <p class="level1">Disables the buffering of the output stream. In normal work situations, curl uses a standard buffered output stream that has the effect that it outputs the data in chunks, not necessarily exactly when the data arrives. Using this option disables that buffering. </p> <p class="level1">Note that this is the negated option name documented. You can use <span Class="emphasis">--buffer</span> to enable buffering again. </p> <p class="level1">Providing --no-buffer multiple times has no extra effect. Disable it again with --buffer. </p> <p class="level1">Example: </p><pre class="level1"> curl --no-buffer https://example.com </pre> <p class="level1">See also <span Class="emphasis">-#, --progress-bar</span>. </p> <p class="level0"><a name="--no-clobber"></a><span class="nroffip">--no-clobber</span> </p> <p class="level1">When used in conjunction with the <a class="emphasis" href="#-o">-o, --output</a>, <a class="emphasis" href="#-J">-J, --remote-header-name</a>, <a class="emphasis" href="#-O">-O, --remote-name</a>, or <a class="emphasis" href="#--remote-name-all">--remote-name-all</a> options, curl avoids overwriting files that already exist. Instead, a dot and a number gets appended to the name of the file that would be created, up to filename.100 after which it does not create any file. </p> <p class="level1">Note that this is the negated option name documented. You can thus use <span Class="emphasis">--clobber</span> to enforce the clobbering, even if <a class="emphasis" href="#-J">-J, --remote-header-name</a> is specified. </p> <p class="level1">Providing --no-clobber multiple times has no extra effect. Disable it again with --clobber. </p> <p class="level1">Example: </p><pre class="level1"> curl --no-clobber --output local/dir/file https://example.com </pre> <p class="level1">Added in 7.83.0. See also <a class="emphasis" href="#-o">-o, --output</a> and <a class="emphasis" href="#-O">-O, --remote-name</a>. </p> <p class="level0"><a name="--no-keepalive"></a><span class="nroffip">--no-keepalive</span> </p> <p class="level1">Disables the use of keepalive messages on the TCP connection. curl otherwise enables them by default. </p> <p class="level1">Note that this is the negated option name documented. You can thus use <span Class="emphasis">--keepalive</span> to enforce keepalive. </p> <p class="level1">Providing --no-keepalive multiple times has no extra effect. Disable it again with --keepalive. </p> <p class="level1">Example: </p><pre class="level1"> curl --no-keepalive https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--keepalive-time">--keepalive-time</a> and <a class="emphasis" href="#--keepalive-cnt">--keepalive-cnt</a>. </p> <p class="level0"><a name="--no-npn"></a><span class="nroffip">--no-npn</span> </p> <p class="level1">(HTTPS) curl never uses NPN, this option has no effect (added in 7.86.0). </p> <p class="level1">Disable the NPN TLS extension. NPN is enabled by default if libcurl was built with an SSL library that supports NPN. NPN is used by a libcurl that supports HTTP/2 to negotiate HTTP/2 support with the server during https sessions. </p> <p class="level1">Providing --no-npn multiple times has no extra effect. Disable it again with --npn. </p> <p class="level1">Example: </p><pre class="level1"> curl --no-npn https://example.com </pre> <p class="level1"><a class="emphasis" href="#--no-npn">--no-npn</a> requires that libcurl is built to support TLS. See also <a class="emphasis" href="#--no-alpn">--no-alpn</a> and <a class="emphasis" href="#--http2">--http2</a>. </p> <p class="level0"><a name="--no-progress-meter"></a><span class="nroffip">--no-progress-meter</span> </p> <p class="level1">Option to switch off the progress meter output without muting or otherwise affecting warning and informational messages like <a class="emphasis" href="#-s">-s, --silent</a> does. </p> <p class="level1">Note that this is the negated option name documented. You can thus use <span Class="emphasis">--progress-meter</span> to enable the progress meter again. </p> <p class="level1">Providing --no-progress-meter multiple times has no extra effect. Disable it again with --progress-meter. </p> <p class="level1">Example: </p><pre class="level1"> curl --no-progress-meter -o store https://example.com </pre> <p class="level1">Added in 7.67.0. See also <a class="emphasis" href="#-v">-v, --verbose</a> and <a class="emphasis" href="#-s">-s, --silent</a>. </p> <p class="level0"><a name="--no-sessionid"></a><span class="nroffip">--no-sessionid</span> </p> <p class="level1">(TLS) Disable curl's use of SSL session-ID caching. By default all transfers are done using the cache. Note that while nothing should ever get hurt by attempting to reuse SSL session-IDs, there seem to be broken SSL implementations in the wild that may require you to disable this in order for you to succeed. </p> <p class="level1">Note that this is the negated option name documented. You can thus use <span Class="emphasis">--sessionid</span> to enforce session-ID caching. </p> <p class="level1">Providing --no-sessionid multiple times has no extra effect. Disable it again with --sessionid. </p> <p class="level1">Example: </p><pre class="level1"> curl --no-sessionid https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-k">-k, --insecure</a>. </p> <p class="level0"><a name="--noproxy"></a><span class="nroffip">--noproxy <no-proxy-list></span> </p> <p class="level1">Comma-separated list of hosts for which not to use a proxy, if one is specified. The only wildcard is a single "*" character, which matches all hosts, and effectively disables the proxy. Each name in this list is matched as either a domain which contains the hostname, or the hostname itself. For example, "local.com" would match "local.com", "local.com:80", and "www.local.com", but not "www.notlocal.com". </p> <p class="level1">This option overrides the environment variables that disable the proxy ("no_proxy" and "NO_PROXY"). If there is an environment variable disabling a proxy, you can set the no proxy list to "" to override it. </p> <p class="level1">IP addresses specified to this option can be provided using CIDR notation (added in 7.86.0): an appended slash and number specifies the number of network bits out of the address to use in the comparison. For example "192.168.0.0/16" would match all addresses starting with "192.168". </p> <p class="level1">If --noproxy is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --noproxy "www.example" https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-x">-x, --proxy</a>. </p> <p class="level0"><a name="--ntlm"></a><span class="nroffip">--ntlm</span> </p> <p class="level1">(HTTP) Use NTLM authentication. The NTLM authentication method was designed by Microsoft and is used by IIS web servers. It is a proprietary protocol, reverse-engineered by clever people and implemented in curl based on their efforts. This kind of behavior should not be endorsed, you should encourage everyone who uses NTLM to switch to a public and documented authentication method instead, such as Digest. </p> <p class="level1">If you want to enable NTLM for your proxy authentication, then use <a class="emphasis" href="#--proxy-ntlm">--proxy-ntlm</a>. </p> <p class="level1">Providing --ntlm multiple times has no extra effect. </p> <p class="level1">Example: </p><pre class="level1"> curl --ntlm -u user:password https://example.com </pre> <p class="level1"><a class="emphasis" href="#--ntlm">--ntlm</a> requires that libcurl is built to support TLS. This option is mutually exclusive with <a class="emphasis" href="#--basic">--basic</a>, <a class="emphasis" href="#--negotiate">--negotiate</a>, <a class="emphasis" href="#--digest">--digest</a> and <a class="emphasis" href="#--anyauth">--anyauth</a>. See also <a class="emphasis" href="#--proxy-ntlm">--proxy-ntlm</a>. </p> <p class="level0"><a name="--ntlm-wb"></a><span class="nroffip">--ntlm-wb</span> </p> <p class="level1">(HTTP) Deprecated option (added in 8.8.0). </p> <p class="level1">Enabled NTLM much in the style <a class="emphasis" href="#--ntlm">--ntlm</a> does, but handed over the authentication to a separate executable that was executed when needed. </p> <p class="level1">Providing --ntlm-wb multiple times has no extra effect. </p> <p class="level1">Example: </p><pre class="level1"> curl --ntlm-wb -u user:password https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--ntlm">--ntlm</a> and <a class="emphasis" href="#--proxy-ntlm">--proxy-ntlm</a>. </p> <p class="level0"><a name="--oauth2-bearer"></a><span class="nroffip">--oauth2-bearer <token></span> </p> <p class="level1">(IMAP LDAP POP3 SMTP HTTP) Specify the Bearer Token for OAUTH 2.0 server authentication. The Bearer Token is used in conjunction with the username which can be specified as part of the <a class="emphasis" href="#--url">--url</a> or <a class="emphasis" href="#-u">-u, --user</a> options. </p> <p class="level1">The Bearer Token and username are formatted according to <a href="https://www.ietf.org/rfc/rfc6750.txt">RFC 6750</a>. </p> <p class="level1">If --oauth2-bearer is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --oauth2-bearer "mF_9.B5f-4.1JqM" https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--basic">--basic</a>, <a class="emphasis" href="#--ntlm">--ntlm</a> and <a class="emphasis" href="#--digest">--digest</a>. </p> <p class="level0"><a name="-o"></a><span class="nroffip">-o, --output <file></span> </p> <p class="level1">Write output to the given file instead of stdout. If you are using globbing to fetch multiple documents, you should quote the URL and you can use "#" followed by a number in the filename. That variable is then replaced with the current string for the URL being fetched. Like in: </p><pre class="level1"> curl "http://{one,two}.example.com" -o "file_#1.txt" </pre> <p class="level1">or use several variables like: </p><pre class="level1"> curl "http://{site,host}.host[1-5].example" -o "#1_#2" </pre> <p class="level1">You may use this option as many times as the number of URLs you have. For example, if you specify two URLs on the same command line, you can use it like this: </p><pre class="level1"> curl -o aa example.com -o bb example.net </pre> <p class="level1">and the order of the -o options and the URLs does not matter, just that the first -o is for the first URL and so on, so the above command line can also be written as </p><pre class="level1"> curl example.com example.net -o aa -o bb </pre> <p class="level1">See also the <a class="emphasis" href="#--create-dirs">--create-dirs</a> option to create the local directories dynamically. Specifying the output as '-' (a single dash) passes the output to stdout. </p> <p class="level1">To suppress response bodies, you can redirect output to /dev/null: </p><pre class="level1"> curl example.com -o /dev/null </pre> <p class="level1">Or for Windows: </p><pre class="level1"> curl example.com -o nul </pre> <p class="level1">Specify the filename as single minus to force the output to stdout, to override curl's internal binary output in terminal prevention: </p><pre class="level1"> curl https://example.com/jpeg -o - </pre> <p class="level1">--output is associated with a single URL. Use it once per URL when you use several URLs in a command line. </p> <p class="level1">Examples: </p><pre class="level1"> curl -o file https://example.com curl "http://{one,two}.example.com" -o "file_#1.txt" curl "http://{site,host}.host[1-5].example" -o "#1_#2" curl -o file https://example.com -o file2 https://example.net </pre> <p class="level1">See also <a class="emphasis" href="#-O">-O, --remote-name</a>, <a class="emphasis" href="#--remote-name-all">--remote-name-all</a> and <a class="emphasis" href="#-J">-J, --remote-header-name</a>. </p> <p class="level0"><a name="--output-dir"></a><span class="nroffip">--output-dir <dir></span> </p> <p class="level1">Specify the directory in which files should be stored, when <a class="emphasis" href="#-O">-O, --remote-name</a> or <a class="emphasis" href="#-o">-o, --output</a> are used. </p> <p class="level1">The given output directory is used for all URLs and output options on the command line, up until the first <a class="emphasis" href="#-">-:, --next</a>. </p> <p class="level1">If the specified target directory does not exist, the operation fails unless <a class="emphasis" href="#--create-dirs">--create-dirs</a> is also used. </p> <p class="level1">If --output-dir is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --output-dir "tmp" -O https://example.com </pre> <p class="level1">Added in 7.73.0. See also <a class="emphasis" href="#-O">-O, --remote-name</a> and <a class="emphasis" href="#-J">-J, --remote-header-name</a>. </p> <p class="level0"><a name="-Z"></a><span class="nroffip">-Z, --parallel</span> </p> <p class="level1">Makes curl perform all transfers in parallel as compared to the regular serial manner. Parallel transfer means that curl runs up to N concurrent transfers simultaneously and if there are more than N transfers to handle, it starts new ones when earlier transfers finish. </p> <p class="level1">With parallel transfers, the progress meter output is different than when doing serial transfers, as it then displays the transfer status for multiple transfers in a single line. </p> <p class="level1">The maximum amount of concurrent transfers is set with <a class="emphasis" href="#--parallel-max">--parallel-max</a> and it defaults to 50. </p> <p class="level1">This option is global and does not need to be specified for each use of --next. </p> <p class="level1">Providing --parallel multiple times has no extra effect. Disable it again with --no-parallel. </p> <p class="level1">Example: </p><pre class="level1"> curl --parallel https://example.com -o file1 https://example.com -o file2 </pre> <p class="level1">Added in 7.66.0. See also <a class="emphasis" href="#-">-:, --next</a>, <a class="emphasis" href="#-v">-v, --verbose</a>, <a class="emphasis" href="#--parallel-max">--parallel-max</a> and <a class="emphasis" href="#--parallel-immediate">--parallel-immediate</a>. </p> <p class="level0"><a name="--parallel-immediate"></a><span class="nroffip">--parallel-immediate</span> </p> <p class="level1">When doing parallel transfers, this option instructs curl to prefer opening up more connections in parallel at once rather than waiting to see if new transfers can be added as multiplexed streams on another connection. </p> <p class="level1">By default, without this option set, curl prefers to wait a little and multiplex new transfers over existing connections. It keeps the number of connections low at the expense of risking a slightly slower transfer startup. </p> <p class="level1">This option is global and does not need to be specified for each use of --next. </p> <p class="level1">Providing --parallel-immediate multiple times has no extra effect. Disable it again with --no-parallel-immediate. </p> <p class="level1">Example: </p><pre class="level1"> curl --parallel-immediate -Z https://example.com -o file1 https://example.com -o file2 </pre> <p class="level1">Added in 7.68.0. See also <a class="emphasis" href="#-Z">-Z, --parallel</a> and <a class="emphasis" href="#--parallel-max">--parallel-max</a>. </p> <p class="level0"><a name="--parallel-max"></a><span class="nroffip">--parallel-max <num></span> </p> <p class="level1">When asked to do parallel transfers, using <a class="emphasis" href="#-Z">-Z, --parallel</a>, this option controls the maximum amount of transfers to do simultaneously. </p> <p class="level1">The default is 50. 300 is the largest supported value. </p> <p class="level1">This option is global and does not need to be specified for each use of --next. </p> <p class="level1">If --parallel-max is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --parallel-max 100 -Z https://example.com ftp://example.com/ </pre> <p class="level1">Added in 7.66.0. See also <a class="emphasis" href="#-Z">-Z, --parallel</a>. </p> <p class="level0"><a name="--pass"></a><span class="nroffip">--pass <phrase></span> </p> <p class="level1">(SSH TLS) Passphrase for the private key. </p> <p class="level1">If --pass is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --pass secret --key file https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--key">--key</a> and <a class="emphasis" href="#-u">-u, --user</a>. </p> <p class="level0"><a name="--path-as-is"></a><span class="nroffip">--path-as-is</span> </p> <p class="level1">Do not handle sequences of /../ or /./ in the given URL path. Normally curl squashes or merges them according to standards but with this option set you tell it not to do that. </p> <p class="level1">Providing --path-as-is multiple times has no extra effect. Disable it again with --no-path-as-is. </p> <p class="level1">Example: </p><pre class="level1"> curl --path-as-is https://example.com/../../etc/passwd </pre> <p class="level1">See also <a class="emphasis" href="#--request-target">--request-target</a>. </p> <p class="level0"><a name="--pinnedpubkey"></a><span class="nroffip">--pinnedpubkey <hashes></span> </p> <p class="level1">(TLS) Use the specified public key file (or hashes) to verify the peer. This can be a path to a file which contains a single public key in PEM or DER format, or any number of base64 encoded sha256 hashes preceded by 'sha256//' and separated by ';'. </p> <p class="level1">When negotiating a TLS or SSL connection, the server sends a certificate indicating its identity. A public key is extracted from this certificate and if it does not exactly match the public key provided to this option, curl aborts the connection before sending or receiving any data. </p> <p class="level1">This option is independent of option <a class="emphasis" href="#-k">-k, --insecure</a>. If you use both options together then the peer is still verified by public key. </p> <p class="level1">PEM/DER support: </p> <p class="level1">OpenSSL and GnuTLS, wolfSSL, mbedTLS , Secure Transport macOS 10.7+/iOS 10+, Schannel </p> <p class="level1">sha256 support: </p> <p class="level1">OpenSSL, GnuTLS and wolfSSL, mbedTLS, Secure Transport macOS 10.7+/iOS 10+, Schannel </p> <p class="level1">Other SSL backends not supported. </p> <p class="level1">If --pinnedpubkey is provided several times, the last set value is used. </p> <p class="level1">Examples: </p><pre class="level1"> curl --pinnedpubkey keyfile https://example.com curl --pinnedpubkey 'sha256//ce118b51897f4452dc' https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--hostpubsha256">--hostpubsha256</a>. </p> <p class="level0"><a name="--post301"></a><span class="nroffip">--post301</span> </p> <p class="level1">(HTTP) Respect <a href="https://www.ietf.org/rfc/rfc7231.txt">RFC 7231</a>/6.4.2 and do not convert POST requests into GET requests when following a 301 redirect. The non-RFC behavior is ubiquitous in web browsers, so curl does the conversion by default to maintain consistency. However, a server may require a POST to remain a POST after such a redirection. This option is meaningful only when using <a class="emphasis" href="#-L">-L, --location</a>. </p> <p class="level1">Providing --post301 multiple times has no extra effect. Disable it again with --no-post301. </p> <p class="level1">Example: </p><pre class="level1"> curl --post301 --location -d "data" https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--post302">--post302</a>, <a class="emphasis" href="#--post303">--post303</a> and <a class="emphasis" href="#-L">-L, --location</a>. </p> <p class="level0"><a name="--post302"></a><span class="nroffip">--post302</span> </p> <p class="level1">(HTTP) Respect <a href="https://www.ietf.org/rfc/rfc7231.txt">RFC 7231</a>/6.4.3 and do not convert POST requests into GET requests when following a 302 redirect. The non-RFC behavior is ubiquitous in web browsers, so curl does the conversion by default to maintain consistency. However, a server may require a POST to remain a POST after such a redirection. This option is meaningful only when using <a class="emphasis" href="#-L">-L, --location</a>. </p> <p class="level1">Providing --post302 multiple times has no extra effect. Disable it again with --no-post302. </p> <p class="level1">Example: </p><pre class="level1"> curl --post302 --location -d "data" https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--post301">--post301</a>, <a class="emphasis" href="#--post303">--post303</a> and <a class="emphasis" href="#-L">-L, --location</a>. </p> <p class="level0"><a name="--post303"></a><span class="nroffip">--post303</span> </p> <p class="level1">(HTTP) Violate <a href="https://www.ietf.org/rfc/rfc7231.txt">RFC 7231</a>/6.4.4 and do not convert POST requests into GET requests when following 303 redirect. A server may require a POST to remain a POST after a 303 redirection. This option is meaningful only when using <a class="emphasis" href="#-L">-L, --location</a>. </p> <p class="level1">Providing --post303 multiple times has no extra effect. Disable it again with --no-post303. </p> <p class="level1">Example: </p><pre class="level1"> curl --post303 --location -d "data" https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--post302">--post302</a>, <a class="emphasis" href="#--post301">--post301</a> and <a class="emphasis" href="#-L">-L, --location</a>. </p> <p class="level0"><a name="--preproxy"></a><span class="nroffip">--preproxy [protocol://]host[:port]</span> </p> <p class="level1">Use the specified SOCKS proxy before connecting to an HTTP or HTTPS <a class="emphasis" href="#-x">-x, --proxy</a>. In such a case curl first connects to the SOCKS proxy and then connects (through SOCKS) to the HTTP or HTTPS proxy. Hence pre proxy. </p> <p class="level1">The pre proxy string should be specified with a protocol:// prefix to specify alternative proxy protocols. Use socks4://, socks4a://, socks5:// or socks5h:// to request the specific SOCKS version to be used. No protocol specified makes curl default to SOCKS4. </p> <p class="level1">If the port number is not specified in the proxy string, it is assumed to be 1080. </p> <p class="level1">User and password that might be provided in the proxy string are URL decoded by curl. This allows you to pass in special characters such as @ by using %40 or pass in a colon with %3a. </p> <p class="level1">If --preproxy is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --preproxy socks5://proxy.example -x http://http.example https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-x">-x, --proxy</a> and <a class="emphasis" href="#--socks5">--socks5</a>. </p> <p class="level0"><a name="-"></a><span class="nroffip">-#, --progress-bar</span> </p> <p class="level1">Make curl display transfer progress as a simple progress bar instead of the standard, more informational, meter. </p> <p class="level1">This progress bar draws a single line of '#' characters across the screen and shows a percentage if the transfer size is known. For transfers without a known size, there is a space ship (-=o=-) that moves back and forth but only while data is being transferred, with a set of flying hash sign symbols on top. </p> <p class="level1">This option is global and does not need to be specified for each use of --next. </p> <p class="level1">Providing --progress-bar multiple times has no extra effect. Disable it again with --no-progress-bar. </p> <p class="level1">Example: </p><pre class="level1"> curl -# -O https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--styled-output">--styled-output</a>. </p> <p class="level0"><a name="--proto"></a><span class="nroffip">--proto <protocols></span> </p> <p class="level1">Limit what protocols to allow for transfers. Protocols are evaluated left to right, are comma separated, and are each a protocol name or 'all', optionally prefixed by zero or more modifiers. Available modifiers are: </p> <p class="level1"><a name=""></a><span class="nroffip">+</span> </p> <p class="level2">Permit this protocol in addition to protocols already permitted (this is the default if no modifier is used). </p> <p class="level1"><a name="-"></a><span class="nroffip">-</span> </p> <p class="level2">Deny this protocol, removing it from the list of protocols already permitted. </p> <p class="level1"><a name=""></a><span class="nroffip">=</span> </p> <p class="level2">Permit only this protocol (ignoring the list already permitted), though subject to later modification by subsequent entries in the comma separated list. </p> <p class="level0"><a name=""></a><span class="nroffip"></span> </p> <p class="level1">For example: <a class="emphasis" href="#--proto">--proto</a> -ftps uses the default protocols, but disables ftps </p> <p class="level1"><a class="emphasis" href="#--proto">--proto</a> -all,https,+http only enables http and https </p> <p class="level1"><a class="emphasis" href="#--proto">--proto</a> =http,https also only enables http and https </p> <p class="level1">Unknown and disabled protocols produce a warning. This allows scripts to safely rely on being able to disable potentially dangerous protocols, without relying upon support for that protocol being built into curl to avoid an error. </p> <p class="level1">This option can be used multiple times, in which case the effect is the same as concatenating the protocols into one instance of the option. </p> <p class="level1">If --proto is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --proto =http,https,sftp https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--proto-redir">--proto-redir</a> and <a class="emphasis" href="#--proto-default">--proto-default</a>. </p> <p class="level0"><a name="--proto-default"></a><span class="nroffip">--proto-default <protocol></span> </p> <p class="level1">Use <span Class="emphasis">protocol</span> for any provided URL missing a scheme. </p> <p class="level1">An unknown or unsupported protocol causes error <span Class="emphasis">CURLE_UNSUPPORTED_PROTOCOL</span>. </p> <p class="level1">This option does not change the default proxy protocol (http). </p> <p class="level1">Without this option set, curl guesses protocol based on the hostname, see <a class="emphasis" href="#--url">--url</a> for details. </p> <p class="level1">If --proto-default is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --proto-default https ftp.example.com </pre> <p class="level1">See also <a class="emphasis" href="#--proto">--proto</a> and <a class="emphasis" href="#--proto-redir">--proto-redir</a>. </p> <p class="level0"><a name="--proto-redir"></a><span class="nroffip">--proto-redir <protocols></span> </p> <p class="level1">Limit what protocols to allow on redirects. Protocols denied by <a class="emphasis" href="#--proto">--proto</a> are not overridden by this option. See <a class="emphasis" href="#--proto">--proto</a> for how protocols are represented. </p> <p class="level1">Example, allow only HTTP and HTTPS on redirect: </p><pre class="level1"> curl --proto-redir -all,http,https http://example.com </pre> <p class="level1">By default curl only allows HTTP, HTTPS, FTP and FTPS on redirects (added in 7.65.2). Specifying <span Class="emphasis">all</span> or <span Class="emphasis">+all</span> enables all protocols on redirects, which is not good for security. </p> <p class="level1">If --proto-redir is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --proto-redir =http,https https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--proto">--proto</a>. </p> <p class="level0"><a name="-x"></a><span class="nroffip">-x, --proxy [protocol://]host[:port]</span> </p> <p class="level1">Use the specified proxy. </p> <p class="level1">The proxy string can be specified with a protocol:// prefix. No protocol specified or http:// it is treated as an HTTP proxy. Use socks4://, socks4a://, socks5:// or socks5h:// to request a specific SOCKS version to be used. </p> <p class="level1">Unix domain sockets are supported for socks proxy. Set localhost for the host part. e.g. socks5h://localhost/path/to/socket.sock </p> <p class="level1">HTTPS proxy support works set with the https:// protocol prefix for OpenSSL and GnuTLS. It also works for BearSSL, mbedTLS, Rustls, Schannel, Secure Transport and wolfSSL (added in 7.87.0). </p> <p class="level1">Unrecognized and unsupported proxy protocols cause an error. Ancient curl versions ignored unknown schemes and used http:// instead. </p> <p class="level1">If the port number is not specified in the proxy string, it is assumed to be 1080. </p> <p class="level1">This option overrides existing environment variables that set the proxy to use. If there is an environment variable setting a proxy, you can set proxy to "" to override it. </p> <p class="level1">All operations that are performed over an HTTP proxy are transparently converted to HTTP. It means that certain protocol specific operations might not be available. This is not the case if you can tunnel through the proxy, as one with the <a class="emphasis" href="#-p">-p, --proxytunnel</a> option. </p> <p class="level1">User and password that might be provided in the proxy string are URL decoded by curl. This allows you to pass in special characters such as @ by using %40 or pass in a colon with %3a. </p> <p class="level1">The proxy host can be specified the same way as the proxy environment variables, including the protocol prefix (<a href="http://)">http://)</a> and the embedded user + password. </p> <p class="level1">When a proxy is used, the active FTP mode as set with <a class="emphasis" href="#-P">-P, --ftp-port</a>, cannot be used. </p> <p class="level1">Doing FTP over an HTTP proxy without <a class="emphasis" href="#-p">-p, --proxytunnel</a> makes curl do HTTP with an FTP URL over the proxy. For such transfers, common FTP specific options do not work, including <span Class="emphasis">--ftp-ssl-reqd</span> and <a class="emphasis" href="#--ftp-ssl-control">--ftp-ssl-control</a>. </p> <p class="level1">If --proxy is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --proxy http://proxy.example https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--socks5">--socks5</a> and <a class="emphasis" href="#--proxy-basic">--proxy-basic</a>. </p> <p class="level0"><a name="--proxy-anyauth"></a><span class="nroffip">--proxy-anyauth</span> </p> <p class="level1">Automatically pick a suitable authentication method when communicating with the given HTTP proxy. This might cause an extra request/response round-trip. </p> <p class="level1">Providing --proxy-anyauth multiple times has no extra effect. </p> <p class="level1">Example: </p><pre class="level1"> curl --proxy-anyauth --proxy-user user:passwd -x proxy https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-x">-x, --proxy</a>, <a class="emphasis" href="#--proxy-basic">--proxy-basic</a> and <a class="emphasis" href="#--proxy-digest">--proxy-digest</a>. </p> <p class="level0"><a name="--proxy-basic"></a><span class="nroffip">--proxy-basic</span> </p> <p class="level1">Use HTTP Basic authentication when communicating with the given proxy. Use <a class="emphasis" href="#--basic">--basic</a> for enabling HTTP Basic with a remote host. Basic is the default authentication method curl uses with proxies. </p> <p class="level1">Providing --proxy-basic multiple times has no extra effect. </p> <p class="level1">Example: </p><pre class="level1"> curl --proxy-basic --proxy-user user:passwd -x proxy https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-x">-x, --proxy</a>, <a class="emphasis" href="#--proxy-anyauth">--proxy-anyauth</a> and <a class="emphasis" href="#--proxy-digest">--proxy-digest</a>. </p> <p class="level0"><a name="--proxy-ca-native"></a><span class="nroffip">--proxy-ca-native</span> </p> <p class="level1">(TLS) Use the CA store from the native operating system to verify the HTTPS proxy. By default, curl uses a CA store provided in a single file or directory, but when using this option it interfaces the operating system's own vault. </p> <p class="level1">This option works for curl on Windows when built to use OpenSSL, wolfSSL (added in 8.3.0) or GnuTLS (added in 8.5.0). When curl on Windows is built to use Schannel, this feature is implied and curl then only uses the native CA store. </p> <p class="level1">Providing --proxy-ca-native multiple times has no extra effect. Disable it again with --no-proxy-ca-native. </p> <p class="level1">Example: </p><pre class="level1"> curl --proxy-ca-native https://example.com </pre> <p class="level1">Added in 8.2.0. See also <a class="emphasis" href="#--cacert">--cacert</a>, <a class="emphasis" href="#--capath">--capath</a>, <a class="emphasis" href="#--dump-ca-embed">--dump-ca-embed</a> and <a class="emphasis" href="#-k">-k, --insecure</a>. </p> <p class="level0"><a name="--proxy-cacert"></a><span class="nroffip">--proxy-cacert <file></span> </p> <p class="level1">Use the specified certificate file to verify the HTTPS proxy. The file may contain multiple CA certificates. The certificate(s) must be in PEM format. </p> <p class="level1">This allows you to use a different trust for the proxy compared to the remote server connected to via the proxy. </p> <p class="level1">Equivalent to <a class="emphasis" href="#--cacert">--cacert</a> but used in HTTPS proxy context. </p> <p class="level1">If --proxy-cacert is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --proxy-cacert CA-file.txt -x https://proxy https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--proxy-capath">--proxy-capath</a>, <a class="emphasis" href="#--cacert">--cacert</a>, <a class="emphasis" href="#--capath">--capath</a>, <a class="emphasis" href="#--dump-ca-embed">--dump-ca-embed</a> and <a class="emphasis" href="#-x">-x, --proxy</a>. </p> <p class="level0"><a name="--proxy-capath"></a><span class="nroffip">--proxy-capath <dir></span> </p> <p class="level1">Same as <a class="emphasis" href="#--capath">--capath</a> but used in HTTPS proxy context. </p> <p class="level1">Use the specified certificate directory to verify the proxy. Multiple paths can be provided by separated with colon (":") (e.g. "path1:path2:path3"). The certificates must be in PEM format, and if curl is built against OpenSSL, the directory must have been processed using the c_rehash utility supplied with OpenSSL. Using <a class="emphasis" href="#--proxy-capath">--proxy-capath</a> can allow OpenSSL-powered curl to make SSL-connections much more efficiently than using <a class="emphasis" href="#--proxy-cacert">--proxy-cacert</a> if the <a class="emphasis" href="#--proxy-cacert">--proxy-cacert</a> file contains many CA certificates. </p> <p class="level1">If this option is set, the default capath value is ignored. </p> <p class="level1">If --proxy-capath is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --proxy-capath /local/directory -x https://proxy https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--proxy-cacert">--proxy-cacert</a>, <a class="emphasis" href="#-x">-x, --proxy</a>, <a class="emphasis" href="#--capath">--capath</a> and <a class="emphasis" href="#--dump-ca-embed">--dump-ca-embed</a>. </p> <p class="level0"><a name="--proxy-cert"></a><span class="nroffip">--proxy-cert <cert[:passwd]></span> </p> <p class="level1">Use the specified client certificate file when communicating with an HTTPS proxy. The certificate must be in PKCS#12 format if using Secure Transport, or PEM format if using any other engine. If the optional password is not specified, it is queried for on the terminal. Use <a class="emphasis" href="#--proxy-key">--proxy-key</a> to provide the private key. </p> <p class="level1">This option is the equivalent to <a class="emphasis" href="#-E">-E, --cert</a> but used in HTTPS proxy context. </p> <p class="level1">If --proxy-cert is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --proxy-cert file -x https://proxy https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-x">-x, --proxy</a>, <a class="emphasis" href="#--proxy-key">--proxy-key</a> and <a class="emphasis" href="#--proxy-cert-type">--proxy-cert-type</a>. </p> <p class="level0"><a name="--proxy-cert-type"></a><span class="nroffip">--proxy-cert-type <type></span> </p> <p class="level1">Set type of the provided client certificate when using HTTPS proxy. PEM, DER, ENG and P12 are recognized types. </p> <p class="level1">The default type depends on the TLS backend and is usually PEM, however for Secure Transport and Schannel it is P12. If <a class="emphasis" href="#--proxy-cert">--proxy-cert</a> is a pkcs11: URI then ENG is the default type. </p> <p class="level1">Equivalent to <a class="emphasis" href="#--cert-type">--cert-type</a> but used in HTTPS proxy context. </p> <p class="level1">If --proxy-cert-type is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --proxy-cert-type PEM --proxy-cert file -x https://proxy https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--proxy-cert">--proxy-cert</a> and <a class="emphasis" href="#--proxy-key">--proxy-key</a>. </p> <p class="level0"><a name="--proxy-ciphers"></a><span class="nroffip">--proxy-ciphers <list></span> </p> <p class="level1">(TLS) Same as <a class="emphasis" href="#--ciphers">--ciphers</a> but used in HTTPS proxy context. </p> <p class="level1">Specify which cipher suites to use in the connection to your HTTPS proxy when it negotiates TLS 1.2 (1.1, 1.0). The list of ciphers suites must specify valid ciphers. Read up on cipher suite details on this URL: </p> <p class="level1"><a href="https://curl.se/docs/ssl-ciphers.html">https://curl.se/docs/ssl-ciphers.html</a> </p> <p class="level1">If --proxy-ciphers is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --proxy-ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256 -x https://proxy https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--proxy-tls13-ciphers">--proxy-tls13-ciphers</a>, <a class="emphasis" href="#--ciphers">--ciphers</a> and <a class="emphasis" href="#-x">-x, --proxy</a>. </p> <p class="level0"><a name="--proxy-crlfile"></a><span class="nroffip">--proxy-crlfile <file></span> </p> <p class="level1">Provide filename for a PEM formatted file with a Certificate Revocation List that specifies peer certificates that are considered revoked when communicating with an HTTPS proxy. </p> <p class="level1">Equivalent to <a class="emphasis" href="#--crlfile">--crlfile</a> but only used in HTTPS proxy context. </p> <p class="level1">If --proxy-crlfile is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --proxy-crlfile rejects.txt -x https://proxy https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--crlfile">--crlfile</a> and <a class="emphasis" href="#-x">-x, --proxy</a>. </p> <p class="level0"><a name="--proxy-digest"></a><span class="nroffip">--proxy-digest</span> </p> <p class="level1">Use HTTP Digest authentication when communicating with the given proxy. Use <a class="emphasis" href="#--digest">--digest</a> for enabling HTTP Digest with a remote host. </p> <p class="level1">Providing --proxy-digest multiple times has no extra effect. </p> <p class="level1">Example: </p><pre class="level1"> curl --proxy-digest --proxy-user user:passwd -x proxy https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-x">-x, --proxy</a>, <a class="emphasis" href="#--proxy-anyauth">--proxy-anyauth</a> and <a class="emphasis" href="#--proxy-basic">--proxy-basic</a>. </p> <p class="level0"><a name="--proxy-header"></a><span class="nroffip">--proxy-header <header/@file></span> </p> <p class="level1">(HTTP) Extra header to include in the request when sending HTTP to a proxy. You may specify any number of extra headers. This is the equivalent option to <a class="emphasis" href="#-H">-H, --header</a> but is for proxy communication only like in CONNECT requests when you want a separate header sent to the proxy to what is sent to the actual remote host. </p> <p class="level1">curl makes sure that each header you add/replace is sent with the proper end-of-line marker, you should thus <span Class="bold">not</span> add that as a part of the header content: do not add newlines or carriage returns, they only mess things up for you. </p> <p class="level1">Headers specified with this option are not included in requests that curl knows are not be sent to a proxy. </p> <p class="level1">This option can take an argument in @filename style, which then adds a header for each line in the input file. Using @- makes curl read the headers from stdin. </p> <p class="level1">This option can be used multiple times to add/replace/remove multiple headers. </p> <p class="level1">--proxy-header can be used several times in a command line </p> <p class="level1">Examples: </p><pre class="level1"> curl --proxy-header "X-First-Name: Joe" -x http://proxy https://example.com curl --proxy-header "User-Agent: surprise" -x http://proxy https://example.com curl --proxy-header "Host:" -x http://proxy https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-x">-x, --proxy</a>. </p> <p class="level0"><a name="--proxy-http2"></a><span class="nroffip">--proxy-http2</span> </p> <p class="level1">(HTTP) Negotiate HTTP/2 with an HTTPS proxy. The proxy might still only offer HTTP/1 and then curl sticks to using that version. </p> <p class="level1">This has no effect for any other kinds of proxies. </p> <p class="level1">Providing --proxy-http2 multiple times has no extra effect. Disable it again with --no-proxy-http2. </p> <p class="level1">Example: </p><pre class="level1"> curl --proxy-http2 -x proxy https://example.com </pre> <p class="level1"><a class="emphasis" href="#--proxy-http2">--proxy-http2</a> requires that libcurl is built to support HTTP/2. Added in 8.1.0. See also <a class="emphasis" href="#-x">-x, --proxy</a>. </p> <p class="level0"><a name="--proxy-insecure"></a><span class="nroffip">--proxy-insecure</span> </p> <p class="level1">Same as <a class="emphasis" href="#-k">-k, --insecure</a> but used in HTTPS proxy context. </p> <p class="level1">Every secure connection curl makes is verified to be secure before the transfer takes place. This option makes curl skip the verification step with a proxy and proceed without checking. </p> <p class="level1">When this option is not used for a proxy using HTTPS, curl verifies the proxy's TLS certificate before it continues: that the certificate contains the right name which matches the hostname and that the certificate has been signed by a CA certificate present in the cert store. See this online resource for further details: <span Class="bold"><a href="https://curl.se/docs/sslcerts.html">https://curl.se/docs/sslcerts.html</a></span> </p> <p class="level1"><span Class="bold">WARNING</span>: using this option makes the transfer to the proxy insecure. </p> <p class="level1">Providing --proxy-insecure multiple times has no extra effect. Disable it again with --no-proxy-insecure. </p> <p class="level1">Example: </p><pre class="level1"> curl --proxy-insecure -x https://proxy https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-x">-x, --proxy</a> and <a class="emphasis" href="#-k">-k, --insecure</a>. </p> <p class="level0"><a name="--proxy-key"></a><span class="nroffip">--proxy-key <key></span> </p> <p class="level1">Specify the filename for your private key when using client certificates with your HTTPS proxy. This option is the equivalent to <a class="emphasis" href="#--key">--key</a> but used in HTTPS proxy context. </p> <p class="level1">If --proxy-key is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --proxy-key here -x https://proxy https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--proxy-key-type">--proxy-key-type</a> and <a class="emphasis" href="#-x">-x, --proxy</a>. </p> <p class="level0"><a name="--proxy-key-type"></a><span class="nroffip">--proxy-key-type <type></span> </p> <p class="level1">Specify the private key file type your <a class="emphasis" href="#--proxy-key">--proxy-key</a> provided private key uses. DER, PEM, and ENG are supported. If not specified, PEM is assumed. </p> <p class="level1">Equivalent to <a class="emphasis" href="#--key-type">--key-type</a> but used in HTTPS proxy context. </p> <p class="level1">If --proxy-key-type is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --proxy-key-type DER --proxy-key here -x https://proxy https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--proxy-key">--proxy-key</a> and <a class="emphasis" href="#-x">-x, --proxy</a>. </p> <p class="level0"><a name="--proxy-negotiate"></a><span class="nroffip">--proxy-negotiate</span> </p> <p class="level1">Use HTTP Negotiate (SPNEGO) authentication when communicating with the given proxy. Use <a class="emphasis" href="#--negotiate">--negotiate</a> for enabling HTTP Negotiate (SPNEGO) with a remote host. </p> <p class="level1">Providing --proxy-negotiate multiple times has no extra effect. </p> <p class="level1">Example: </p><pre class="level1"> curl --proxy-negotiate --proxy-user user:passwd -x proxy https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--proxy-anyauth">--proxy-anyauth</a>, <a class="emphasis" href="#--proxy-basic">--proxy-basic</a> and <a class="emphasis" href="#--proxy-service-name">--proxy-service-name</a>. </p> <p class="level0"><a name="--proxy-ntlm"></a><span class="nroffip">--proxy-ntlm</span> </p> <p class="level1">Use HTTP NTLM authentication when communicating with the given proxy. Use <a class="emphasis" href="#--ntlm">--ntlm</a> for enabling NTLM with a remote host. </p> <p class="level1">Providing --proxy-ntlm multiple times has no extra effect. </p> <p class="level1">Example: </p><pre class="level1"> curl --proxy-ntlm --proxy-user user:passwd -x http://proxy https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--proxy-negotiate">--proxy-negotiate</a>, <a class="emphasis" href="#--proxy-anyauth">--proxy-anyauth</a> and <a class="emphasis" href="#-U">-U, --proxy-user</a>. </p> <p class="level0"><a name="--proxy-pass"></a><span class="nroffip">--proxy-pass <phrase></span> </p> <p class="level1">Passphrase for the private key for HTTPS proxy client certificate. </p> <p class="level1">Equivalent to <a class="emphasis" href="#--pass">--pass</a> but used in HTTPS proxy context. </p> <p class="level1">If --proxy-pass is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --proxy-pass secret --proxy-key here -x https://proxy https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-x">-x, --proxy</a> and <a class="emphasis" href="#--proxy-key">--proxy-key</a>. </p> <p class="level0"><a name="--proxy-pinnedpubkey"></a><span class="nroffip">--proxy-pinnedpubkey <hashes></span> </p> <p class="level1">(TLS) Use the specified public key file (or hashes) to verify the proxy. This can be a path to a file which contains a single public key in PEM or DER format, or any number of base64 encoded sha256 hashes preceded by 'sha256//' and separated by ';'. </p> <p class="level1">When negotiating a TLS or SSL connection, the server sends a certificate indicating its identity. A public key is extracted from this certificate and if it does not exactly match the public key provided to this option, curl aborts the connection before sending or receiving any data. </p> <p class="level1">Before curl 8.10.0 this option did not work due to a bug. </p> <p class="level1">If --proxy-pinnedpubkey is provided several times, the last set value is used. </p> <p class="level1">Examples: </p><pre class="level1"> curl --proxy-pinnedpubkey keyfile https://example.com curl --proxy-pinnedpubkey 'sha256//ce118b51897f4452dc' https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--pinnedpubkey">--pinnedpubkey</a> and <a class="emphasis" href="#-x">-x, --proxy</a>. </p> <p class="level0"><a name="--proxy-service-name"></a><span class="nroffip">--proxy-service-name <name></span> </p> <p class="level1">Set the service name for SPNEGO when doing proxy authentication. </p> <p class="level1">If --proxy-service-name is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --proxy-service-name "shrubbery" -x proxy https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--service-name">--service-name</a>, <a class="emphasis" href="#-x">-x, --proxy</a> and <a class="emphasis" href="#--proxy-negotiate">--proxy-negotiate</a>. </p> <p class="level0"><a name="--proxy-ssl-allow-beast"></a><span class="nroffip">--proxy-ssl-allow-beast</span> </p> <p class="level1">Do not work around a security flaw in the TLS1.0 protocol known as BEAST when communicating to an HTTPS proxy. If this option is not used, the TLS layer may use workarounds known to cause interoperability problems with some older server implementations. </p> <p class="level1">This option only changes how curl does TLS 1.0 with an HTTPS proxy and has no effect on later TLS versions. </p> <p class="level1"><span Class="bold">WARNING</span>: this option loosens the TLS security, and by using this flag you ask for exactly that. </p> <p class="level1">Equivalent to <a class="emphasis" href="#--ssl-allow-beast">--ssl-allow-beast</a> but used in HTTPS proxy context. </p> <p class="level1">Providing --proxy-ssl-allow-beast multiple times has no extra effect. Disable it again with --no-proxy-ssl-allow-beast. </p> <p class="level1">Example: </p><pre class="level1"> curl --proxy-ssl-allow-beast -x https://proxy https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--ssl-allow-beast">--ssl-allow-beast</a> and <a class="emphasis" href="#-x">-x, --proxy</a>. </p> <p class="level0"><a name="--proxy-ssl-auto-client-cert"></a><span class="nroffip">--proxy-ssl-auto-client-cert</span> </p> <p class="level1">Same as <a class="emphasis" href="#--ssl-auto-client-cert">--ssl-auto-client-cert</a> but used in HTTPS proxy context. </p> <p class="level1">This is only supported by Schannel. </p> <p class="level1">Providing --proxy-ssl-auto-client-cert multiple times has no extra effect. Disable it again with --no-proxy-ssl-auto-client-cert. </p> <p class="level1">Example: </p><pre class="level1"> curl --proxy-ssl-auto-client-cert -x https://proxy https://example.com </pre> <p class="level1">Added in 7.77.0. See also <a class="emphasis" href="#--ssl-auto-client-cert">--ssl-auto-client-cert</a> and <a class="emphasis" href="#-x">-x, --proxy</a>. </p> <p class="level0"><a name="--proxy-tls13-ciphers"></a><span class="nroffip">--proxy-tls13-ciphers <list></span> </p> <p class="level1">(TLS) Same as <a class="emphasis" href="#--tls13-ciphers">--tls13-ciphers</a> but used in HTTPS proxy context. </p> <p class="level1">Specify which cipher suites to use in the connection to your HTTPS proxy when it negotiates TLS 1.3. The list of ciphers suites must specify valid ciphers. Read up on TLS 1.3 cipher suite details on this URL: </p> <p class="level1"><a href="https://curl.se/docs/ssl-ciphers.html">https://curl.se/docs/ssl-ciphers.html</a> </p> <p class="level1">This option is used when curl is built to use OpenSSL 1.1.1 or later, Schannel, wolfSSL, or mbedTLS 3.6.0 or later. </p> <p class="level1">Before curl 8.10.0 with mbedTLS or wolfSSL, TLS 1.3 cipher suites were set by using the <a class="emphasis" href="#--proxy-ciphers">--proxy-ciphers</a> option. </p> <p class="level1">If --proxy-tls13-ciphers is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --proxy-tls13-ciphers TLS_AES_128_GCM_SHA256 -x proxy https://example.com </pre> <p class="level1">Added in 7.61.0. See also <a class="emphasis" href="#--proxy-ciphers">--proxy-ciphers</a>, <a class="emphasis" href="#--tls13-ciphers">--tls13-ciphers</a> and <a class="emphasis" href="#-x">-x, --proxy</a>. </p> <p class="level0"><a name="--proxy-tlsauthtype"></a><span class="nroffip">--proxy-tlsauthtype <type></span> </p> <p class="level1">Set TLS authentication type with HTTPS proxy. The only supported option is "SRP", for TLS-SRP (<a href="https://www.ietf.org/rfc/rfc5054.txt">RFC 5054</a>). This option works only if the underlying libcurl is built with TLS-SRP support. </p> <p class="level1">Equivalent to <a class="emphasis" href="#--tlsauthtype">--tlsauthtype</a> but used in HTTPS proxy context. </p> <p class="level1">If --proxy-tlsauthtype is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --proxy-tlsauthtype SRP -x https://proxy https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-x">-x, --proxy</a>, <a class="emphasis" href="#--proxy-tlsuser">--proxy-tlsuser</a> and <a class="emphasis" href="#--proxy-tlspassword">--proxy-tlspassword</a>. </p> <p class="level0"><a name="--proxy-tlspassword"></a><span class="nroffip">--proxy-tlspassword <string></span> </p> <p class="level1">Set password to use with the TLS authentication method specified with <a class="emphasis" href="#--proxy-tlsauthtype">--proxy-tlsauthtype</a> when using HTTPS proxy. Requires that <a class="emphasis" href="#--proxy-tlsuser">--proxy-tlsuser</a> is set. </p> <p class="level1">This option does not work with TLS 1.3. </p> <p class="level1">Equivalent to <a class="emphasis" href="#--tlspassword">--tlspassword</a> but used in HTTPS proxy context. </p> <p class="level1">If --proxy-tlspassword is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --proxy-tlspassword passwd -x https://proxy https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-x">-x, --proxy</a> and <a class="emphasis" href="#--proxy-tlsuser">--proxy-tlsuser</a>. </p> <p class="level0"><a name="--proxy-tlsuser"></a><span class="nroffip">--proxy-tlsuser <name></span> </p> <p class="level1">Set username for use for HTTPS proxy with the TLS authentication method specified with <a class="emphasis" href="#--proxy-tlsauthtype">--proxy-tlsauthtype</a>. Requires that <a class="emphasis" href="#--proxy-tlspassword">--proxy-tlspassword</a> also is set. </p> <p class="level1">This option does not work with TLS 1.3. </p> <p class="level1">If --proxy-tlsuser is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --proxy-tlsuser smith -x https://proxy https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-x">-x, --proxy</a> and <a class="emphasis" href="#--proxy-tlspassword">--proxy-tlspassword</a>. </p> <p class="level0"><a name="--proxy-tlsv1"></a><span class="nroffip">--proxy-tlsv1</span> </p> <p class="level1">Use at least TLS version 1.x when negotiating with an HTTPS proxy. That means TLS version 1.0 or higher </p> <p class="level1">Equivalent to <a class="emphasis" href="#-1">-1, --tlsv1</a> but for an HTTPS proxy context. </p> <p class="level1">Providing --proxy-tlsv1 multiple times has no extra effect. </p> <p class="level1">Example: </p><pre class="level1"> curl --proxy-tlsv1 -x https://proxy https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-x">-x, --proxy</a>. </p> <p class="level0"><a name="-U"></a><span class="nroffip">-U, --proxy-user <user:password></span> </p> <p class="level1">Specify the username and password to use for proxy authentication. </p> <p class="level1">If you use a Windows SSPI-enabled curl binary and do either Negotiate or NTLM authentication then you can tell curl to select the username and password from your environment by specifying a single colon with this option: "-U :". </p> <p class="level1">On systems where it works, curl hides the given option argument from process listings. This is not enough to protect credentials from possibly getting seen by other users on the same system as they still are visible for a moment before cleared. Such sensitive data should be retrieved from a file instead or similar and never used in clear text in a command line. </p> <p class="level1">If --proxy-user is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --proxy-user smith:secret -x proxy https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--proxy-pass">--proxy-pass</a>. </p> <p class="level0"><a name="--proxy10"></a><span class="nroffip">--proxy1.0 <host[:port]></span> </p> <p class="level1">Use the specified HTTP 1.0 proxy. If the port number is not specified, it is assumed at port 1080. </p> <p class="level1">The only difference between this and the HTTP proxy option <a class="emphasis" href="#-x">-x, --proxy</a>, is that attempts to use CONNECT through the proxy specifies an HTTP 1.0 protocol instead of the default HTTP 1.1. </p> <p class="level1">Providing --proxy1.0 multiple times has no extra effect. </p> <p class="level1">Example: </p><pre class="level1"> curl --proxy1.0 http://proxy https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-x">-x, --proxy</a>, <a class="emphasis" href="#--socks5">--socks5</a> and <a class="emphasis" href="#--preproxy">--preproxy</a>. </p> <p class="level0"><a name="-p"></a><span class="nroffip">-p, --proxytunnel</span> </p> <p class="level1">When an HTTP proxy is used <a class="emphasis" href="#-x">-x, --proxy</a>, this option makes curl tunnel the traffic through the proxy. The tunnel approach is made with the HTTP proxy CONNECT request and requires that the proxy allows direct connect to the remote port number curl wants to tunnel through to. </p> <p class="level1">To suppress proxy CONNECT response headers when curl is set to output headers use <a class="emphasis" href="#--suppress-connect-headers">--suppress-connect-headers</a>. </p> <p class="level1">Providing --proxytunnel multiple times has no extra effect. Disable it again with --no-proxytunnel. </p> <p class="level1">Example: </p><pre class="level1"> curl --proxytunnel -x http://proxy https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-x">-x, --proxy</a>. </p> <p class="level0"><a name="--pubkey"></a><span class="nroffip">--pubkey <key></span> </p> <p class="level1">(SFTP SCP) Public key filename. Allows you to provide your public key in this separate file. </p> <p class="level1">curl attempts to automatically extract the public key from the private key file, so passing this option is generally not required. Note that this public key extraction requires libcurl to be linked against a copy of libssh2 1.2.8 or higher that is itself linked against OpenSSL. </p> <p class="level1">If --pubkey is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --pubkey file.pub sftp://example.com/ </pre> <p class="level1">See also <a class="emphasis" href="#--pass">--pass</a>. </p> <p class="level0"><a name="-Q"></a><span class="nroffip">-Q, --quote <command></span> </p> <p class="level1">(FTP SFTP) Send an arbitrary command to the remote FTP or SFTP server. Quote commands are sent BEFORE the transfer takes place (just after the initial <span Class="bold">PWD</span> command in an FTP transfer, to be exact). To make commands take place after a successful transfer, prefix them with a dash '-'. </p> <p class="level1">(FTP only) To make commands be sent after curl has changed the working directory, just before the file transfer command(s), prefix the command with a '+'. This is not performed when a directory listing is performed. </p> <p class="level1">You may specify any number of commands. </p> <p class="level1">By default curl stops at first failure. To make curl continue even if the command fails, prefix the command with an asterisk (*). Otherwise, if the server returns failure for one of the commands, the entire operation is aborted. </p> <p class="level1">You must send syntactically correct FTP commands as <a href="https://www.ietf.org/rfc/rfc959.txt">RFC 959</a> defines to FTP servers, or one of the commands listed below to SFTP servers. </p> <p class="level1">SFTP is a binary protocol. Unlike for FTP, curl interprets SFTP quote commands itself before sending them to the server. Filenames may be quoted shell-style to embed spaces or special characters. Following is the list of all supported SFTP quote commands: </p> <p class="level1"><a name="atime"></a><span class="nroffip">atime date file</span> </p> <p class="level2">The atime command sets the last access time of the file named by the file operand. The date expression can be all sorts of date strings, see the <span Class="emphasis">curl_getdate(3)</span> man page for date expression details. (Added in 7.73.0) </p> <p class="level1"><a name="chgrp"></a><span class="nroffip">chgrp group file</span> </p> <p class="level2">The chgrp command sets the group ID of the file named by the file operand to the group ID specified by the group operand. The group operand is a decimal integer group ID. </p> <p class="level1"><a name="chmod"></a><span class="nroffip">chmod mode file</span> </p> <p class="level2">The chmod command modifies the file mode bits of the specified file. The mode operand is an octal integer mode number. </p> <p class="level1"><a name="chown"></a><span class="nroffip">chown user file</span> </p> <p class="level2">The chown command sets the owner of the file named by the file operand to the user ID specified by the user operand. The user operand is a decimal integer user ID. </p> <p class="level1"><a name="ln"></a><span class="nroffip">ln source_file target_file</span> </p> <p class="level2">The ln and symlink commands create a symbolic link at the target_file location pointing to the source_file location. </p> <p class="level1"><a name="mkdir"></a><span class="nroffip">mkdir directory_name</span> </p> <p class="level2">The mkdir command creates the directory named by the directory_name operand. </p> <p class="level1"><a name="mtime"></a><span class="nroffip">mtime date file</span> </p> <p class="level2">The mtime command sets the last modification time of the file named by the file operand. The date expression can be all sorts of date strings, see the <span Class="emphasis">curl_getdate(3)</span> man page for date expression details. (Added in 7.73.0) </p> <p class="level1"><a name="pwd"></a><span class="nroffip">pwd</span> </p> <p class="level2">The pwd command returns the absolute path name of the current working directory. </p> <p class="level1"><a name="rename"></a><span class="nroffip">rename source target</span> </p> <p class="level2">The rename command renames the file or directory named by the source operand to the destination path named by the target operand. </p> <p class="level1"><a name="rm"></a><span class="nroffip">rm file</span> </p> <p class="level2">The rm command removes the file specified by the file operand. </p> <p class="level1"><a name="rmdir"></a><span class="nroffip">rmdir directory</span> </p> <p class="level2">The rmdir command removes the directory entry specified by the directory operand, provided it is empty. </p> <p class="level1"><a name="symlink"></a><span class="nroffip">symlink source_file target_file</span> </p> <p class="level2">See ln. </p> <p class="level0"><a name=""></a><span class="nroffip"></span> </p> <p class="level1">--quote can be used several times in a command line </p> <p class="level1">Example: </p><pre class="level1"> curl --quote "DELE file" ftp://example.com/foo </pre> <p class="level1">See also <a class="emphasis" href="#-X">-X, --request</a>. </p> <p class="level0"><a name="--random-file"></a><span class="nroffip">--random-file <file></span> </p> <p class="level1">Deprecated option. This option is ignored (added in 7.84.0). Prior to that it only had an effect on curl if built to use old versions of OpenSSL. </p> <p class="level1">Specify the path name to file containing random data. The data may be used to seed the random engine for SSL connections. </p> <p class="level1">If --random-file is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --random-file rubbish https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--egd-file">--egd-file</a>. </p> <p class="level0"><a name="-r"></a><span class="nroffip">-r, --range <range></span> </p> <p class="level1">(HTTP FTP SFTP FILE) Retrieve a byte range (i.e. a partial document) from an HTTP/1.1, FTP or SFTP server or a local FILE. Ranges can be specified in a number of ways. </p> <p class="level1"><a name="0-499"></a><span class="nroffip">0-499</span> </p> <p class="level2">specifies the first 500 bytes </p> <p class="level1"><a name="500-999"></a><span class="nroffip">500-999</span> </p> <p class="level2">specifies the second 500 bytes </p> <p class="level1"><a name="-500"></a><span class="nroffip">-500</span> </p> <p class="level2">specifies the last 500 bytes </p> <p class="level1"><a name="9500-"></a><span class="nroffip">9500-</span> </p> <p class="level2">specifies the bytes from offset 9500 and forward </p> <p class="level1"><a name="0-0-1"></a><span class="nroffip">0-0,-1</span> </p> <p class="level2">specifies the first and last byte only(*)(HTTP) </p> <p class="level1"><a name="100-199500-599"></a><span class="nroffip">100-199,500-599</span> </p> <p class="level2">specifies two separate 100-byte ranges(*) (HTTP) </p> <p class="level0"><a name=""></a><span class="nroffip"></span> </p> <p class="level1">(*) = NOTE that these make the server reply with a multipart response, which is returned as-is by curl. Parsing or otherwise transforming this response is the responsibility of the caller. </p> <p class="level1">Only digit characters (0-9) are valid in the 'start' and 'stop' fields of the 'start-stop' range syntax. If a non-digit character is given in the range, the server's response is unspecified, depending on the server's configuration. </p> <p class="level1">Many HTTP/1.1 servers do not have this feature enabled, so that when you attempt to get a range, curl instead gets the whole document. </p> <p class="level1">FTP and SFTP range downloads only support the simple 'start-stop' syntax (optionally with one of the numbers omitted). FTP use depends on the extended FTP command SIZE. </p> <p class="level1">If --range is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --range 22-44 https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-C">-C, --continue-at</a> and <a class="emphasis" href="#-a">-a, --append</a>. </p> <p class="level0"><a name="--rate"></a><span class="nroffip">--rate <max request rate></span> </p> <p class="level1">Specify the maximum transfer frequency you allow curl to use - in number of transfer starts per time unit (sometimes called request rate). Without this option, curl starts the next transfer as fast as possible. </p> <p class="level1">If given several URLs and a transfer completes faster than the allowed rate, curl waits until the next transfer is started to maintain the requested rate. This option has no effect when <a class="emphasis" href="#-Z">-Z, --parallel</a> is used. </p> <p class="level1">The request rate is provided as "N/U" where N is an integer number and U is a time unit. Supported units are 's' (second), 'm' (minute), 'h' (hour) and 'd' /(day, as in a 24 hour unit). The default time unit, if no "/U" is provided, is number of transfers per hour. </p> <p class="level1">If curl is told to allow 10 requests per minute, it does not start the next request until 6 seconds have elapsed since the previous transfer was started. </p> <p class="level1">This function uses millisecond resolution. If the allowed frequency is set more than 1000 per second, it instead runs unrestricted. </p> <p class="level1">When retrying transfers, enabled with <a class="emphasis" href="#--retry">--retry</a>, the separate retry delay logic is used and not this setting. </p> <p class="level1">Starting in version 8.10.0, you can specify number of time units in the rate expression. Make curl do no more than 5 transfers per 15 seconds with "5/15s" or limit it to 3 transfers per 4 hours with "3/4h". No spaces allowed. </p> <p class="level1">This option is global and does not need to be specified for each use of --next. </p> <p class="level1">If --rate is provided several times, the last set value is used. </p> <p class="level1">Examples: </p><pre class="level1"> curl --rate 2/s https://example.com ... curl --rate 3/h https://example.com ... curl --rate 14/m https://example.com ... </pre> <p class="level1">Added in 7.84.0. See also <a class="emphasis" href="#--limit-rate">--limit-rate</a> and <a class="emphasis" href="#--retry-delay">--retry-delay</a>. </p> <p class="level0"><a name="--raw"></a><span class="nroffip">--raw</span> </p> <p class="level1">(HTTP) When used, it disables all internal HTTP decoding of content or transfer encodings and instead makes them passed on unaltered, raw. </p> <p class="level1">Providing --raw multiple times has no extra effect. Disable it again with --no-raw. </p> <p class="level1">Example: </p><pre class="level1"> curl --raw https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--tr-encoding">--tr-encoding</a>. </p> <p class="level0"><a name="-e"></a><span class="nroffip">-e, --referer <URL></span> </p> <p class="level1">(HTTP) Set the referrer URL in the HTTP request. This can also be set with the <a class="emphasis" href="#-H">-H, --header</a> flag of course. When used with <a class="emphasis" href="#-L">-L, --location</a> you can append ";auto"" to the <a class="emphasis" href="#-e">-e, --referer</a> URL to make curl automatically set the previous URL when it follows a Location: header. The ";auto" string can be used alone, even if you do not set an initial <a class="emphasis" href="#-e">-e, --referer</a>. </p> <p class="level1">If --referer is provided several times, the last set value is used. </p> <p class="level1">Examples: </p><pre class="level1"> curl --referer "https://fake.example" https://example.com curl --referer "https://fake.example;auto" -L https://example.com curl --referer ";auto" -L https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-A">-A, --user-agent</a> and <a class="emphasis" href="#-H">-H, --header</a>. </p> <p class="level0"><a name="-J"></a><span class="nroffip">-J, --remote-header-name</span> </p> <p class="level1">(HTTP) Tell the <a class="emphasis" href="#-O">-O, --remote-name</a> option to use the server-specified Content-Disposition filename instead of extracting a filename from the URL. If the server-provided filename contains a path, that is stripped off before the filename is used. </p> <p class="level1">The file is saved in the current directory, or in the directory specified with <a class="emphasis" href="#--output-dir">--output-dir</a>. </p> <p class="level1">If the server specifies a filename and a file with that name already exists in the destination directory, it is not overwritten and an error occurs - unless you allow it by using the <span Class="emphasis">--clobber</span> option. If the server does not specify a filename then this option has no effect. </p> <p class="level1">There is no attempt to decode %-sequences (yet) in the provided filename, so this option may provide you with rather unexpected filenames. </p> <p class="level1">This feature uses the name from the "filename" field, it does not yet support the "filename*" field (filenames with explicit character sets). </p> <p class="level1"><span Class="bold">WARNING</span>: Exercise judicious use of this option, especially on Windows. A rogue server could send you the name of a DLL or other file that could be loaded automatically by Windows or some third party software. </p> <p class="level1">Providing --remote-header-name multiple times has no extra effect. Disable it again with --no-remote-header-name. </p> <p class="level1">Example: </p><pre class="level1"> curl -OJ https://example.com/file </pre> <p class="level1">See also <a class="emphasis" href="#-O">-O, --remote-name</a>. </p> <p class="level0"><a name="-O"></a><span class="nroffip">-O, --remote-name</span> </p> <p class="level1">Write output to a local file named like the remote file we get. (Only the file part of the remote file is used, the path is cut off.) </p> <p class="level1">The file is saved in the current working directory. If you want the file saved in a different directory, make sure you change the current working directory before invoking curl with this option or use <a class="emphasis" href="#--output-dir">--output-dir</a>. </p> <p class="level1">The remote filename to use for saving is extracted from the given URL, nothing else, and if it already exists it is overwritten. If you want the server to be able to choose the filename refer to <a class="emphasis" href="#-J">-J, --remote-header-name</a> which can be used in addition to this option. If the server chooses a filename and that name already exists it is not overwritten. </p> <p class="level1">There is no URL decoding done on the filename. If it has %20 or other URL encoded parts of the name, they end up as-is as filename. </p> <p class="level1">You may use this option as many times as the number of URLs you have. </p> <p class="level1">Before curl 8.10.0, curl returned an error if the URL ended with a slash, which means that there is no filename part in the URL. Starting in 8.10.0, curl sets the filename to the last directory part of the URL or if that also is missing to "curl_response" (without extension) for this situation. </p> <p class="level1">--remote-name is associated with a single URL. Use it once per URL when you use several URLs in a command line. </p> <p class="level1">Examples: </p><pre class="level1"> curl -O https://example.com/filename curl -O https://example.com/filename -O https://example.com/file2 </pre> <p class="level1">See also <a class="emphasis" href="#--remote-name-all">--remote-name-all</a>, <a class="emphasis" href="#--output-dir">--output-dir</a> and <a class="emphasis" href="#-J">-J, --remote-header-name</a>. </p> <p class="level0"><a name="--remote-name-all"></a><span class="nroffip">--remote-name-all</span> </p> <p class="level1">Change the default action for all given URLs to be dealt with as if <a class="emphasis" href="#-O">-O, --remote-name</a> were used for each one. If you want to disable that for a specific URL after <a class="emphasis" href="#--remote-name-all">--remote-name-all</a> has been used, you must use "-o -" or <span Class="emphasis">--no-remote-name</span>. </p> <p class="level1">Providing --remote-name-all multiple times has no extra effect. Disable it again with --no-remote-name-all. </p> <p class="level1">Example: </p><pre class="level1"> curl --remote-name-all ftp://example.com/file1 ftp://example.com/file2 </pre> <p class="level1">See also <a class="emphasis" href="#-O">-O, --remote-name</a>. </p> <p class="level0"><a name="-R"></a><span class="nroffip">-R, --remote-time</span> </p> <p class="level1">Makes curl attempt to figure out the timestamp of the remote file that is getting downloaded, and if that is available make the local file get that same timestamp. </p> <p class="level1">Providing --remote-time multiple times has no extra effect. Disable it again with --no-remote-time. </p> <p class="level1">Example: </p><pre class="level1"> curl --remote-time -o foo https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-O">-O, --remote-name</a> and <a class="emphasis" href="#-z">-z, --time-cond</a>. </p> <p class="level0"><a name="--remove-on-error"></a><span class="nroffip">--remove-on-error</span> </p> <p class="level1">Remove output file if an error occurs. If curl returns an error when told to save output in a local file. This prevents curl from leaving a partial file in the case of an error during transfer. </p> <p class="level1">If the output is not a regular file, this option has no effect. </p> <p class="level1">Providing --remove-on-error multiple times has no extra effect. Disable it again with --no-remove-on-error. </p> <p class="level1">Example: </p><pre class="level1"> curl --remove-on-error -o output https://example.com </pre> <p class="level1">Added in 7.83.0. See also <a class="emphasis" href="#-f">-f, --fail</a>. </p> <p class="level0"><a name="-X"></a><span class="nroffip">-X, --request <method></span> </p> <p class="level1">Change the method to use when starting the transfer. </p> <p class="level1">curl passes on the verbatim string you give it in the request without any filter or other safe guards. That includes white space and control characters. </p> <p class="level1"><a name="HTTP"></a><span class="nroffip">HTTP</span> </p> <p class="level2">Specifies a custom request method to use when communicating with the HTTP server. The specified request method is used instead of the method otherwise used (which defaults to <span Class="emphasis">GET</span>). Read the HTTP 1.1 specification for details and explanations. Common additional HTTP requests include <span Class="emphasis">PUT</span> and <span Class="emphasis">DELETE</span>, while related technologies like WebDAV offers <span Class="emphasis">PROPFIND</span>, <span Class="emphasis">COPY</span>, <span Class="emphasis">MOVE</span> and more. </p> <p class="level2">Normally you do not need this option. All sorts of <span Class="emphasis">GET</span>, <span Class="emphasis">HEAD</span>, <span Class="emphasis">POST</span> and <span Class="emphasis">PUT</span> requests are rather invoked by using dedicated command line options. </p> <p class="level2">This option only changes the actual word used in the HTTP request, it does not alter the way curl behaves. For example if you want to make a proper HEAD request, using -X HEAD does not suffice. You need to use the <a class="emphasis" href="#-I">-I, --head</a> option. </p> <p class="level2">The method string you set with <a class="emphasis" href="#-X">-X, --request</a> is used for all requests, which if you for example use <a class="emphasis" href="#-L">-L, --location</a> may cause unintended side-effects when curl does not change request method according to the HTTP 30x response codes - and similar. </p> <p class="level1"><a name="FTP"></a><span class="nroffip">FTP</span> </p> <p class="level2">Specifies a custom FTP command to use instead of <span Class="emphasis">LIST</span> when doing file lists with FTP. </p> <p class="level1"><a name="POP3"></a><span class="nroffip">POP3</span> </p> <p class="level2">Specifies a custom POP3 command to use instead of <span Class="emphasis">LIST</span> or <span Class="emphasis">RETR</span>. </p> <p class="level1"><a name="IMAP"></a><span class="nroffip">IMAP</span> </p> <p class="level2">Specifies a custom IMAP command to use instead of <span Class="emphasis">LIST</span>. </p> <p class="level1"><a name="SMTP"></a><span class="nroffip">SMTP</span> </p> <p class="level2">Specifies a custom SMTP command to use instead of <span Class="emphasis">HELP</span> or <span Class="bold">VRFY</span>. </p> <p class="level0"><a name=""></a><span class="nroffip"></span> </p> <p class="level1">If --request is provided several times, the last set value is used. </p> <p class="level1">Examples: </p><pre class="level1"> curl -X "DELETE" https://example.com curl -X NLST ftp://example.com/ </pre> <p class="level1">See also <a class="emphasis" href="#--request-target">--request-target</a>. </p> <p class="level0"><a name="--request-target"></a><span class="nroffip">--request-target <path></span> </p> <p class="level1">(HTTP) Use an alternative target (path) instead of using the path as provided in the URL. Particularly useful when wanting to issue HTTP requests without leading slash or other data that does not follow the regular URL pattern, like "OPTIONS *". </p> <p class="level1">curl passes on the verbatim string you give it its the request without any filter or other safe guards. That includes white space and control characters. </p> <p class="level1">If --request-target is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --request-target "*" -X OPTIONS https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-X">-X, --request</a>. </p> <p class="level0"><a name="--resolve"></a><span class="nroffip">--resolve <[+]host:port:addr[,addr]...></span> </p> <p class="level1">Provide a custom address for a specific host and port pair. Using this, you can make the curl requests(s) use a specified address and prevent the otherwise normally resolved address to be used. Consider it a sort of /etc/hosts alternative provided on the command line. The port number should be the number used for the specific protocol the host is used for. It means you need several entries if you want to provide address for the same host but different ports. </p> <p class="level1">By specifying "*" as host you can tell curl to resolve any host and specific port pair to the specified address. Wildcard is resolved last so any <a class="emphasis" href="#--resolve">--resolve</a> with a specific host and port is used first. </p> <p class="level1">The provided address set by this option is used even if <a class="emphasis" href="#-4">-4, --ipv4</a> or <a class="emphasis" href="#-6">-6, --ipv6</a> is set to make curl use another IP version. </p> <p class="level1">By prefixing the host with a '+' you can make the entry time out after curl's default timeout (1 minute). Note that this only makes sense for long running parallel transfers with a lot of files. In such cases, if this option is used curl tries to resolve the host as it normally would once the timeout has expired. </p> <p class="level1">To redirect connects from a specific hostname or any hostname, independently of port number, consider the <a class="emphasis" href="#--connect-to">--connect-to</a> option. </p> <p class="level1">Support for resolving with wildcard was added in 7.64.0. </p> <p class="level1">Support for the '+' prefix was added in 7.75.0. </p> <p class="level1">--resolve can be used several times in a command line </p> <p class="level1">Example: </p><pre class="level1"> curl --resolve example.com:443:127.0.0.1 https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--connect-to">--connect-to</a> and <a class="emphasis" href="#--alt-svc">--alt-svc</a>. </p> <p class="level0"><a name="--retry"></a><span class="nroffip">--retry <num></span> </p> <p class="level1">If a transient error is returned when curl tries to perform a transfer, it retries this number of times before giving up. Setting the number to 0 makes curl do no retries (which is the default). Transient error means either: a timeout, an FTP 4xx response code or an HTTP 408, 429, 500, 502, 503 or 504 response code. </p> <p class="level1">When curl is about to retry a transfer, it first waits one second and then for all forthcoming retries it doubles the waiting time until it reaches 10 minutes which then remains delay between the rest of the retries. By using <a class="emphasis" href="#--retry-delay">--retry-delay</a> you disable this exponential backoff algorithm. See also <a class="emphasis" href="#--retry-max-time">--retry-max-time</a> to limit the total time allowed for retries. </p> <p class="level1">curl complies with the Retry-After: response header if one was present to know when to issue the next retry (added in 7.66.0). </p> <p class="level1">If --retry is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --retry 7 https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--retry-max-time">--retry-max-time</a>. </p> <p class="level0"><a name="--retry-all-errors"></a><span class="nroffip">--retry-all-errors</span> </p> <p class="level1">Retry on any error. This option is used together with <a class="emphasis" href="#--retry">--retry</a>. </p> <p class="level1">This option is the "sledgehammer" of retrying. Do not use this option by default (for example in your <span Class="bold">curlrc</span>), there may be unintended consequences such as sending or receiving duplicate data. Do not use with redirected input or output. You might be better off handling your unique problems in a shell script. Please read the example below. </p> <p class="level1"><span Class="bold">WARNING</span>: For server compatibility curl attempts to retry failed flaky transfers as close as possible to how they were started, but this is not possible with redirected input or output. For example, before retrying it removes output data from a failed partial transfer that was written to an output file. However this is not true of data redirected to a | pipe or > file, which are not reset. We strongly suggest you do not parse or record output via redirect in combination with this option, since you may receive duplicate data. </p> <p class="level1">By default curl does not return error for transfers with an HTTP response code that indicates an HTTP error, if the transfer was successful. For example, if a server replies 404 Not Found and the reply is fully received then that is not an error. When <a class="emphasis" href="#--retry">--retry</a> is used then curl retries on some HTTP response codes that indicate transient HTTP errors, but that does not include most 4xx response codes such as 404. If you want to retry on all response codes that indicate HTTP errors (4xx and 5xx) then combine with <a class="emphasis" href="#-f">-f, --fail</a>. </p> <p class="level1">Providing --retry-all-errors multiple times has no extra effect. Disable it again with --no-retry-all-errors. </p> <p class="level1">Example: </p><pre class="level1"> curl --retry 5 --retry-all-errors https://example.com </pre> <p class="level1">Added in 7.71.0. See also <a class="emphasis" href="#--retry">--retry</a>. </p> <p class="level0"><a name="--retry-connrefused"></a><span class="nroffip">--retry-connrefused</span> </p> <p class="level1">In addition to the other conditions, consider ECONNREFUSED as a transient error too for <a class="emphasis" href="#--retry">--retry</a>. This option is used together with <a class="emphasis" href="#--retry">--retry</a>. </p> <p class="level1">Providing --retry-connrefused multiple times has no extra effect. Disable it again with --no-retry-connrefused. </p> <p class="level1">Example: </p><pre class="level1"> curl --retry-connrefused --retry 7 https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--retry">--retry</a> and <a class="emphasis" href="#--retry-all-errors">--retry-all-errors</a>. </p> <p class="level0"><a name="--retry-delay"></a><span class="nroffip">--retry-delay <seconds></span> </p> <p class="level1">Make curl sleep this amount of time before each retry when a transfer has failed with a transient error (it changes the default backoff time algorithm between retries). This option is only interesting if <a class="emphasis" href="#--retry">--retry</a> is also used. Setting this delay to zero makes curl use the default backoff time. </p> <p class="level1">If --retry-delay is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --retry-delay 5 --retry 7 https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--retry">--retry</a>. </p> <p class="level0"><a name="--retry-max-time"></a><span class="nroffip">--retry-max-time <seconds></span> </p> <p class="level1">The retry timer is reset before the first transfer attempt. Retries are done as usual (see <a class="emphasis" href="#--retry">--retry</a>) as long as the timer has not reached this given limit. Notice that if the timer has not reached the limit, the request is made and while performing, it may take longer than this given time period. To limit a single request's maximum time, use <a class="emphasis" href="#-m">-m, --max-time</a>. Set this option to zero to not timeout retries. </p> <p class="level1">If --retry-max-time is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --retry-max-time 30 --retry 10 https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--retry">--retry</a>. </p> <p class="level0"><a name="--sasl-authzid"></a><span class="nroffip">--sasl-authzid <identity></span> </p> <p class="level1">Use this authorization identity (<span Class="bold">authzid</span>), during SASL PLAIN authentication, in addition to the authentication identity (<span Class="bold">authcid</span>) as specified by <a class="emphasis" href="#-u">-u, --user</a>. </p> <p class="level1">If the option is not specified, the server derives the <span Class="bold">authzid</span> from the <span Class="bold">authcid</span>, but if specified, and depending on the server implementation, it may be used to access another user's inbox, that the user has been granted access to, or a shared mailbox for example. </p> <p class="level1">If --sasl-authzid is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --sasl-authzid zid imap://example.com/ </pre> <p class="level1">Added in 7.66.0. See also <a class="emphasis" href="#--login-options">--login-options</a>. </p> <p class="level0"><a name="--sasl-ir"></a><span class="nroffip">--sasl-ir</span> </p> <p class="level1">Enable initial response in SASL authentication. </p> <p class="level1">Providing --sasl-ir multiple times has no extra effect. Disable it again with --no-sasl-ir. </p> <p class="level1">Example: </p><pre class="level1"> curl --sasl-ir imap://example.com/ </pre> <p class="level1">See also <a class="emphasis" href="#--sasl-authzid">--sasl-authzid</a>. </p> <p class="level0"><a name="--service-name"></a><span class="nroffip">--service-name <name></span> </p> <p class="level1">Set the service name for SPNEGO. </p> <p class="level1">If --service-name is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --service-name sockd/server https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--negotiate">--negotiate</a> and <a class="emphasis" href="#--proxy-service-name">--proxy-service-name</a>. </p> <p class="level0"><a name="-S"></a><span class="nroffip">-S, --show-error</span> </p> <p class="level1">When used with <a class="emphasis" href="#-s">-s, --silent</a>, it makes curl show an error message if it fails. </p> <p class="level1">This option is global and does not need to be specified for each use of --next. </p> <p class="level1">Providing --show-error multiple times has no extra effect. Disable it again with --no-show-error. </p> <p class="level1">Example: </p><pre class="level1"> curl --show-error --silent https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--no-progress-meter">--no-progress-meter</a>. </p> <p class="level0"><a name="-i"></a><span class="nroffip">-i, --show-headers</span> </p> <p class="level1">(HTTP FTP) Show response headers in the output. HTTP response headers can include things like server name, cookies, date of the document, HTTP version and more. With non-HTTP protocols, the "headers" are other server communication. </p> <p class="level1">This option makes the response headers get saved in the same stream/output as the data. <a class="emphasis" href="#-D">-D, --dump-header</a> exists to save headers in a separate stream. </p> <p class="level1">To view the request headers, consider the <a class="emphasis" href="#-v">-v, --verbose</a> option. </p> <p class="level1">Prior to 7.75.0 curl did not print the headers if <a class="emphasis" href="#-f">-f, --fail</a> was used in combination with this option and there was error reported by server. </p> <p class="level1">This option was called <span Class="emphasis">--include</span> before 8.10.0. The previous name remains functional. </p> <p class="level1">Providing --show-headers multiple times has no extra effect. Disable it again with --no-show-headers. </p> <p class="level1">Example: </p><pre class="level1"> curl -i https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-v">-v, --verbose</a> and <a class="emphasis" href="#-D">-D, --dump-header</a>. </p> <p class="level0"><a name="-s"></a><span class="nroffip">-s, --silent</span> </p> <p class="level1">Silent or quiet mode. Do not show progress meter or error messages. Makes Curl mute. It still outputs the data you ask for, potentially even to the terminal/stdout unless you redirect it. </p> <p class="level1">Use <a class="emphasis" href="#-S">-S, --show-error</a> in addition to this option to disable progress meter but still show error messages. </p> <p class="level1">Providing --silent multiple times has no extra effect. Disable it again with --no-silent. </p> <p class="level1">Example: </p><pre class="level1"> curl -s https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-v">-v, --verbose</a>, <a class="emphasis" href="#--stderr">--stderr</a> and <a class="emphasis" href="#--no-progress-meter">--no-progress-meter</a>. </p> <p class="level0"><a name="--skip-existing"></a><span class="nroffip">--skip-existing</span> </p> <p class="level1">If there is a local file present when a download is requested, the operation is skipped. Note that curl cannot know if the local file was previously downloaded fine, or if it is incomplete etc, it just knows if there is a filename present in the file system or not and it skips the transfer if it is. </p> <p class="level1">Providing --skip-existing multiple times has no extra effect. Disable it again with --no-skip-existing. </p> <p class="level1">Example: </p><pre class="level1"> curl --skip-existing --output local/dir/file https://example.com </pre> <p class="level1">Added in 8.10.0. See also <a class="emphasis" href="#-o">-o, --output</a>, <a class="emphasis" href="#-O">-O, --remote-name</a> and <a class="emphasis" href="#--no-clobber">--no-clobber</a>. </p> <p class="level0"><a name="--socks4"></a><span class="nroffip">--socks4 <host[:port]></span> </p> <p class="level1">Use the specified SOCKS4 proxy. If the port number is not specified, it is assumed at port 1080. Using this socket type make curl resolve the hostname and passing the address on to the proxy. </p> <p class="level1">To specify proxy on a Unix domain socket, use localhost for host, e.g. "socks4://localhost/path/to/socket.sock" </p> <p class="level1">This option overrides any previous use of <a class="emphasis" href="#-x">-x, --proxy</a>, as they are mutually exclusive. </p> <p class="level1">This option is superfluous since you can specify a socks4 proxy with <a class="emphasis" href="#-x">-x, --proxy</a> using a socks4:// protocol prefix. </p> <p class="level1"><a class="emphasis" href="#--preproxy">--preproxy</a> can be used to specify a SOCKS proxy at the same time proxy is used with an HTTP/HTTPS proxy. In such a case, curl first connects to the SOCKS proxy and then connects (through SOCKS) to the HTTP or HTTPS proxy. </p> <p class="level1">If --socks4 is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --socks4 hostname:4096 https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--socks4a">--socks4a</a>, <a class="emphasis" href="#--socks5">--socks5</a> and <a class="emphasis" href="#--socks5-hostname">--socks5-hostname</a>. </p> <p class="level0"><a name="--socks4a"></a><span class="nroffip">--socks4a <host[:port]></span> </p> <p class="level1">Use the specified SOCKS4a proxy. If the port number is not specified, it is assumed at port 1080. This asks the proxy to resolve the hostname. </p> <p class="level1">To specify proxy on a Unix domain socket, use localhost for host, e.g. "socks4a://localhost/path/to/socket.sock" </p> <p class="level1">This option overrides any previous use of <a class="emphasis" href="#-x">-x, --proxy</a>, as they are mutually exclusive. </p> <p class="level1">This option is superfluous since you can specify a socks4a proxy with <a class="emphasis" href="#-x">-x, --proxy</a> using a socks4a:// protocol prefix. </p> <p class="level1"><a class="emphasis" href="#--preproxy">--preproxy</a> can be used to specify a SOCKS proxy at the same time <a class="emphasis" href="#-x">-x, --proxy</a> is used with an HTTP/HTTPS proxy. In such a case, curl first connects to the SOCKS proxy and then connects (through SOCKS) to the HTTP or HTTPS proxy. </p> <p class="level1">If --socks4a is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --socks4a hostname:4096 https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--socks4">--socks4</a>, <a class="emphasis" href="#--socks5">--socks5</a> and <a class="emphasis" href="#--socks5-hostname">--socks5-hostname</a>. </p> <p class="level0"><a name="--socks5"></a><span class="nroffip">--socks5 <host[:port]></span> </p> <p class="level1">Use the specified SOCKS5 proxy - but resolve the hostname locally. If the port number is not specified, it is assumed at port 1080. </p> <p class="level1">To specify proxy on a Unix domain socket, use localhost for host, e.g. "socks5://localhost/path/to/socket.sock" </p> <p class="level1">This option overrides any previous use of <a class="emphasis" href="#-x">-x, --proxy</a>, as they are mutually exclusive. </p> <p class="level1">This option is superfluous since you can specify a socks5 proxy with <a class="emphasis" href="#-x">-x, --proxy</a> using a socks5:// protocol prefix. </p> <p class="level1"><a class="emphasis" href="#--preproxy">--preproxy</a> can be used to specify a SOCKS proxy at the same time <a class="emphasis" href="#-x">-x, --proxy</a> is used with an HTTP/HTTPS proxy. In such a case, curl first connects to the SOCKS proxy and then connects (through SOCKS) to the HTTP or HTTPS proxy. </p> <p class="level1">This option does not work with FTPS or LDAP. </p> <p class="level1">If --socks5 is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --socks5 proxy.example:7000 https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--socks5-hostname">--socks5-hostname</a> and <a class="emphasis" href="#--socks4a">--socks4a</a>. </p> <p class="level0"><a name="--socks5-basic"></a><span class="nroffip">--socks5-basic</span> </p> <p class="level1">Use username/password authentication when connecting to a SOCKS5 proxy. The username/password authentication is enabled by default. Use <a class="emphasis" href="#--socks5-gssapi">--socks5-gssapi</a> to force GSS-API authentication to SOCKS5 proxies. </p> <p class="level1">Providing --socks5-basic multiple times has no extra effect. </p> <p class="level1">Example: </p><pre class="level1"> curl --socks5-basic --socks5 hostname:4096 https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--socks5">--socks5</a>. </p> <p class="level0"><a name="--socks5-gssapi"></a><span class="nroffip">--socks5-gssapi</span> </p> <p class="level1">Use GSS-API authentication when connecting to a SOCKS5 proxy. The GSS-API authentication is enabled by default (if curl is compiled with GSS-API support). Use <a class="emphasis" href="#--socks5-basic">--socks5-basic</a> to force username/password authentication to SOCKS5 proxies. </p> <p class="level1">Providing --socks5-gssapi multiple times has no extra effect. Disable it again with --no-socks5-gssapi. </p> <p class="level1">Example: </p><pre class="level1"> curl --socks5-gssapi --socks5 hostname:4096 https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--socks5">--socks5</a>. </p> <p class="level0"><a name="--socks5-gssapi-nec"></a><span class="nroffip">--socks5-gssapi-nec</span> </p> <p class="level1">As part of the GSS-API negotiation a protection mode is negotiated. <a href="https://www.ietf.org/rfc/rfc1961.txt">RFC 1961</a> says in section 4.3/4.4 it should be protected, but the NEC reference implementation does not. The option <a class="emphasis" href="#--socks5-gssapi-nec">--socks5-gssapi-nec</a> allows the unprotected exchange of the protection mode negotiation. </p> <p class="level1">Providing --socks5-gssapi-nec multiple times has no extra effect. Disable it again with --no-socks5-gssapi-nec. </p> <p class="level1">Example: </p><pre class="level1"> curl --socks5-gssapi-nec --socks5 hostname:4096 https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--socks5">--socks5</a>. </p> <p class="level0"><a name="--socks5-gssapi-service"></a><span class="nroffip">--socks5-gssapi-service <name></span> </p> <p class="level1">Set the service name for a socks server. Default is <span Class="bold">rcmd/server-fqdn</span>. </p> <p class="level1">If --socks5-gssapi-service is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --socks5-gssapi-service sockd --socks5 hostname:4096 https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--socks5">--socks5</a>. </p> <p class="level0"><a name="--socks5-hostname"></a><span class="nroffip">--socks5-hostname <host[:port]></span> </p> <p class="level1">Use the specified SOCKS5 proxy (and let the proxy resolve the hostname). If the port number is not specified, it is assumed at port 1080. </p> <p class="level1">To specify proxy on a Unix domain socket, use localhost for host, e.g. "socks5h://localhost/path/to/socket.sock" </p> <p class="level1">This option overrides any previous use of <a class="emphasis" href="#-x">-x, --proxy</a>, as they are mutually exclusive. </p> <p class="level1">This option is superfluous since you can specify a socks5 hostname proxy with <a class="emphasis" href="#-x">-x, --proxy</a> using a socks5h:// protocol prefix. </p> <p class="level1"><a class="emphasis" href="#--preproxy">--preproxy</a> can be used to specify a SOCKS proxy at the same time <a class="emphasis" href="#-x">-x, --proxy</a> is used with an HTTP/HTTPS proxy. In such a case, curl first connects to the SOCKS proxy and then connects (through SOCKS) to the HTTP or HTTPS proxy. </p> <p class="level1">If --socks5-hostname is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --socks5-hostname proxy.example:7000 https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--socks5">--socks5</a> and <a class="emphasis" href="#--socks4a">--socks4a</a>. </p> <p class="level0"><a name="-Y"></a><span class="nroffip">-Y, --speed-limit <speed></span> </p> <p class="level1">If a transfer is slower than this set speed (in bytes per second) for a given number of seconds, it gets aborted. The time period is set with <a class="emphasis" href="#-y">-y, --speed-time</a> and is 30 seconds by default. </p> <p class="level1">If --speed-limit is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --speed-limit 300 --speed-time 10 https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-y">-y, --speed-time</a>, <a class="emphasis" href="#--limit-rate">--limit-rate</a> and <a class="emphasis" href="#-m">-m, --max-time</a>. </p> <p class="level0"><a name="-y"></a><span class="nroffip">-y, --speed-time <seconds></span> </p> <p class="level1">If a transfer runs slower than speed-limit bytes per second during a speed-time period, the transfer is aborted. If speed-time is used, the default speed-limit is 1 unless set with <a class="emphasis" href="#-Y">-Y, --speed-limit</a>. </p> <p class="level1">This option controls transfers (in both directions) but does not affect slow connects etc. If this is a concern for you, try the <a class="emphasis" href="#--connect-timeout">--connect-timeout</a> option. </p> <p class="level1">If --speed-time is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --speed-limit 300 --speed-time 10 https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-Y">-Y, --speed-limit</a> and <a class="emphasis" href="#--limit-rate">--limit-rate</a>. </p> <p class="level0"><a name="--ssl"></a><span class="nroffip">--ssl</span> </p> <p class="level1">(FTP IMAP POP3 SMTP LDAP) Warning: this is considered an insecure option. Consider using <a class="emphasis" href="#--ssl-reqd">--ssl-reqd</a> instead to be sure curl upgrades to a secure connection. </p> <p class="level1">Try to use SSL/TLS for the connection - often referred to as STARTTLS or STLS because of the involved commands. Reverts to a non-secure connection if the server does not support SSL/TLS. See also <a class="emphasis" href="#--ftp-ssl-control">--ftp-ssl-control</a> and <a class="emphasis" href="#--ssl-reqd">--ssl-reqd</a> for different levels of encryption required. </p> <p class="level1">This option is handled in LDAP (added in 7.81.0). It is fully supported by the OpenLDAP backend and ignored by the generic ldap backend. </p> <p class="level1">Please note that a server may close the connection if the negotiation does not succeed. </p> <p class="level1">This option was formerly known as <span Class="emphasis">--ftp-ssl</span>. That option name can still be used but might be removed in a future version. </p> <p class="level1">Providing --ssl multiple times has no extra effect. Disable it again with --no-ssl. </p> <p class="level1">Example: </p><pre class="level1"> curl --ssl pop3://example.com/ </pre> <p class="level1">See also <a class="emphasis" href="#--ssl-reqd">--ssl-reqd</a>, <a class="emphasis" href="#-k">-k, --insecure</a> and <a class="emphasis" href="#--ciphers">--ciphers</a>. </p> <p class="level0"><a name="--ssl-allow-beast"></a><span class="nroffip">--ssl-allow-beast</span> </p> <p class="level1">(TLS) Do not work around a security flaw in the TLS1.0 protocol known as BEAST. If this option is not used, the TLS layer may use workarounds known to cause interoperability problems with some older server implementations. </p> <p class="level1">This option only changes how curl does TLS 1.0 and has no effect on later TLS versions. </p> <p class="level1"><span Class="bold">WARNING</span>: this option loosens the TLS security, and by using this flag you ask for exactly that. </p> <p class="level1">Providing --ssl-allow-beast multiple times has no extra effect. Disable it again with --no-ssl-allow-beast. </p> <p class="level1">Example: </p><pre class="level1"> curl --ssl-allow-beast https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--proxy-ssl-allow-beast">--proxy-ssl-allow-beast</a> and <a class="emphasis" href="#-k">-k, --insecure</a>. </p> <p class="level0"><a name="--ssl-auto-client-cert"></a><span class="nroffip">--ssl-auto-client-cert</span> </p> <p class="level1">(TLS) (Schannel) Automatically locate and use a client certificate for authentication, when requested by the server. Since the server can request any certificate that supports client authentication in the OS certificate store it could be a privacy violation and unexpected. </p> <p class="level1">Providing --ssl-auto-client-cert multiple times has no extra effect. Disable it again with --no-ssl-auto-client-cert. </p> <p class="level1">Example: </p><pre class="level1"> curl --ssl-auto-client-cert https://example.com </pre> <p class="level1">Added in 7.77.0. See also <a class="emphasis" href="#--proxy-ssl-auto-client-cert">--proxy-ssl-auto-client-cert</a>. </p> <p class="level0"><a name="--ssl-no-revoke"></a><span class="nroffip">--ssl-no-revoke</span> </p> <p class="level1">(TLS) (Schannel) Disable certificate revocation checks. WARNING: this option loosens the SSL security, and by using this flag you ask for exactly that. </p> <p class="level1">Providing --ssl-no-revoke multiple times has no extra effect. Disable it again with --no-ssl-no-revoke. </p> <p class="level1">Example: </p><pre class="level1"> curl --ssl-no-revoke https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--crlfile">--crlfile</a>. </p> <p class="level0"><a name="--ssl-reqd"></a><span class="nroffip">--ssl-reqd</span> </p> <p class="level1">(FTP IMAP POP3 SMTP LDAP) Require SSL/TLS for the connection - often referred to as STARTTLS or STLS because of the involved commands. Terminates the connection if the transfer cannot be upgraded to use SSL/TLS. </p> <p class="level1">This option is handled in LDAP (added in 7.81.0). It is fully supported by the OpenLDAP backend and rejected by the generic ldap backend if explicit TLS is required. </p> <p class="level1">This option is unnecessary if you use a URL scheme that in itself implies immediate and implicit use of TLS, like for FTPS, IMAPS, POP3S, SMTPS and LDAPS. Such a transfer always fails if the TLS handshake does not work. </p> <p class="level1">This option was formerly known as <span Class="emphasis">--ftp-ssl-reqd</span>. </p> <p class="level1">Providing --ssl-reqd multiple times has no extra effect. Disable it again with --no-ssl-reqd. </p> <p class="level1">Example: </p><pre class="level1"> curl --ssl-reqd ftp://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--ssl">--ssl</a> and <a class="emphasis" href="#-k">-k, --insecure</a>. </p> <p class="level0"><a name="--ssl-revoke-best-effort"></a><span class="nroffip">--ssl-revoke-best-effort</span> </p> <p class="level1">(TLS) (Schannel) Ignore certificate revocation checks when they failed due to missing/offline distribution points for the revocation check lists. </p> <p class="level1">Providing --ssl-revoke-best-effort multiple times has no extra effect. Disable it again with --no-ssl-revoke-best-effort. </p> <p class="level1">Example: </p><pre class="level1"> curl --ssl-revoke-best-effort https://example.com </pre> <p class="level1">Added in 7.70.0. See also <a class="emphasis" href="#--crlfile">--crlfile</a> and <a class="emphasis" href="#-k">-k, --insecure</a>. </p> <p class="level0"><a name="-2"></a><span class="nroffip">-2, --sslv2</span> </p> <p class="level1">(SSL) This option previously asked curl to use SSLv2, but is now ignored (added in 7.77.0). SSLv2 is widely considered insecure (see <a href="https://www.ietf.org/rfc/rfc6176.txt">RFC 6176</a>). </p> <p class="level1">Providing --sslv2 multiple times has no extra effect. </p> <p class="level1">Example: </p><pre class="level1"> curl --sslv2 https://example.com </pre> <p class="level1"><a class="emphasis" href="#-2">-2, --sslv2</a> requires that libcurl is built to support TLS. This option is mutually exclusive with <a class="emphasis" href="#-3">-3, --sslv3</a>, <a class="emphasis" href="#-1">-1, --tlsv1</a>, <a class="emphasis" href="#--tlsv11">--tlsv1.1</a> and <a class="emphasis" href="#--tlsv12">--tlsv1.2</a>. See also <a class="emphasis" href="#--http11">--http1.1</a> and <a class="emphasis" href="#--http2">--http2</a>. </p> <p class="level0"><a name="-3"></a><span class="nroffip">-3, --sslv3</span> </p> <p class="level1">(SSL) This option previously asked curl to use SSLv3, but is now ignored (added in 7.77.0). SSLv3 is widely considered insecure (see <a href="https://www.ietf.org/rfc/rfc7568.txt">RFC 7568</a>). </p> <p class="level1">Providing --sslv3 multiple times has no extra effect. </p> <p class="level1">Example: </p><pre class="level1"> curl --sslv3 https://example.com </pre> <p class="level1"><a class="emphasis" href="#-3">-3, --sslv3</a> requires that libcurl is built to support TLS. This option is mutually exclusive with <a class="emphasis" href="#-2">-2, --sslv2</a>, <a class="emphasis" href="#-1">-1, --tlsv1</a>, <a class="emphasis" href="#--tlsv11">--tlsv1.1</a> and <a class="emphasis" href="#--tlsv12">--tlsv1.2</a>. See also <a class="emphasis" href="#--http11">--http1.1</a> and <a class="emphasis" href="#--http2">--http2</a>. </p> <p class="level0"><a name="--stderr"></a><span class="nroffip">--stderr <file></span> </p> <p class="level1">Redirect all writes to stderr to the specified file instead. If the filename is a plain '-', it is instead written to stdout. </p> <p class="level1">This option is global and does not need to be specified for each use of --next. </p> <p class="level1">If --stderr is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --stderr output.txt https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-v">-v, --verbose</a> and <a class="emphasis" href="#-s">-s, --silent</a>. </p> <p class="level0"><a name="--styled-output"></a><span class="nroffip">--styled-output</span> </p> <p class="level1">Enable automatic use of bold font styles when writing HTTP headers to the terminal. Use <span Class="emphasis">--no-styled-output</span> to switch them off. </p> <p class="level1">Styled output requires a terminal that supports bold fonts. This feature is not present on curl for Windows due to lack of this capability. </p> <p class="level1">This option is global and does not need to be specified for each use of --next. </p> <p class="level1">Providing --styled-output multiple times has no extra effect. Disable it again with --no-styled-output. </p> <p class="level1">Example: </p><pre class="level1"> curl --styled-output -I https://example.com </pre> <p class="level1">Added in 7.61.0. See also <a class="emphasis" href="#-I">-I, --head</a> and <a class="emphasis" href="#-v">-v, --verbose</a>. </p> <p class="level0"><a name="--suppress-connect-headers"></a><span class="nroffip">--suppress-connect-headers</span> </p> <p class="level1">When <a class="emphasis" href="#-p">-p, --proxytunnel</a> is used and a CONNECT request is made do not output proxy CONNECT response headers. This option is meant to be used with <a class="emphasis" href="#-D">-D, --dump-header</a> or <a class="emphasis" href="#-i">-i, --show-headers</a> which are used to show protocol headers in the output. It has no effect on debug options such as <a class="emphasis" href="#-v">-v, --verbose</a> or <a class="emphasis" href="#--trace">--trace</a>, or any statistics. </p> <p class="level1">Providing --suppress-connect-headers multiple times has no extra effect. Disable it again with --no-suppress-connect-headers. </p> <p class="level1">Example: </p><pre class="level1"> curl --suppress-connect-headers --show-headers -x proxy https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-D">-D, --dump-header</a>, <a class="emphasis" href="#-i">-i, --show-headers</a> and <a class="emphasis" href="#-p">-p, --proxytunnel</a>. </p> <p class="level0"><a name="--tcp-fastopen"></a><span class="nroffip">--tcp-fastopen</span> </p> <p class="level1">Enable use of TCP Fast Open (<a href="https://www.ietf.org/rfc/rfc7413.txt">RFC 7413</a>). TCP Fast Open is a TCP extension that allows data to get sent earlier over the connection (before the final handshake ACK) if the client and server have been connected previously. </p> <p class="level1">Providing --tcp-fastopen multiple times has no extra effect. Disable it again with --no-tcp-fastopen. </p> <p class="level1">Example: </p><pre class="level1"> curl --tcp-fastopen https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--false-start">--false-start</a>. </p> <p class="level0"><a name="--tcp-nodelay"></a><span class="nroffip">--tcp-nodelay</span> </p> <p class="level1">Turn on the TCP_NODELAY option. See the <span Class="emphasis">curl_easy_setopt(3)</span> man page for details about this option. </p> <p class="level1">curl sets this option by default and you need to explicitly switch it off if you do not want it on. </p> <p class="level1">Providing --tcp-nodelay multiple times has no extra effect. Disable it again with --no-tcp-nodelay. </p> <p class="level1">Example: </p><pre class="level1"> curl --tcp-nodelay https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-N">-N, --no-buffer</a>. </p> <p class="level0"><a name="-t"></a><span class="nroffip">-t, --telnet-option <opt=val></span> </p> <p class="level1">Pass options to the telnet protocol. Supported options are: </p> <p class="level1"><a name="TTYPEterm"></a><span class="nroffip">TTYPE=<term></span> </p> <p class="level2">Sets the terminal type. </p> <p class="level1"><a name="XDISPLOCX"></a><span class="nroffip">XDISPLOC=<X display></span> </p> <p class="level2">Sets the X display location. </p> <p class="level1"><a name="NEWENVvarval"></a><span class="nroffip">NEW_ENV=<var,val></span> </p> <p class="level2">Sets an environment variable. </p> <p class="level0"><a name=""></a><span class="nroffip"></span> </p> <p class="level1">--telnet-option can be used several times in a command line </p> <p class="level1">Example: </p><pre class="level1"> curl -t TTYPE=vt100 telnet://example.com/ </pre> <p class="level1">See also <a class="emphasis" href="#-K">-K, --config</a>. </p> <p class="level0"><a name="--tftp-blksize"></a><span class="nroffip">--tftp-blksize <value></span> </p> <p class="level1">(TFTP) Set the TFTP <span Class="bold">BLKSIZE</span> option (must be 512 or larger). This is the block size that curl tries to use when transferring data to or from a TFTP server. By default 512 bytes are used. </p> <p class="level1">If --tftp-blksize is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --tftp-blksize 1024 tftp://example.com/file </pre> <p class="level1">See also <a class="emphasis" href="#--tftp-no-options">--tftp-no-options</a>. </p> <p class="level0"><a name="--tftp-no-options"></a><span class="nroffip">--tftp-no-options</span> </p> <p class="level1">(TFTP) Do not to send TFTP options requests. This improves interop with some legacy servers that do not acknowledge or properly implement TFTP options. When this option is used <a class="emphasis" href="#--tftp-blksize">--tftp-blksize</a> is ignored. </p> <p class="level1">Providing --tftp-no-options multiple times has no extra effect. Disable it again with --no-tftp-no-options. </p> <p class="level1">Example: </p><pre class="level1"> curl --tftp-no-options tftp://192.168.0.1/ </pre> <p class="level1">See also <a class="emphasis" href="#--tftp-blksize">--tftp-blksize</a>. </p> <p class="level0"><a name="-z"></a><span class="nroffip">-z, --time-cond <time></span> </p> <p class="level1">(HTTP FTP) Request a file that has been modified later than the given time and date, or one that has been modified before that time. The date expression can be all sorts of date strings or if it does not match any internal ones, it is treated as a filename and curl tries to get the modification date (mtime) from that file instead. See the <span Class="emphasis">curl_getdate(3)</span> man pages for date expression details. </p> <p class="level1">Start the date expression with a dash (-) to make it request for a document that is older than the given date/time, default is a document that is newer than the specified date/time. </p> <p class="level1">If provided a non-existing file, curl outputs a warning about that fact and proceeds to do the transfer without a time condition. </p> <p class="level1">If --time-cond is provided several times, the last set value is used. </p> <p class="level1">Examples: </p><pre class="level1"> curl -z "Wed 01 Sep 2021 12:18:00" https://example.com curl -z "-Wed 01 Sep 2021 12:18:00" https://example.com curl -z file https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--etag-compare">--etag-compare</a> and <a class="emphasis" href="#-R">-R, --remote-time</a>. </p> <p class="level0"><a name="--tls-earlydata"></a><span class="nroffip">--tls-earlydata</span> </p> <p class="level1">(TLS) Enable the use of TLSv1.3 early data, also known as '0RTT' where possible. This has security implications for the requests sent that way. </p> <p class="level1">This option is used when curl is built to use GnuTLS. </p> <p class="level1">If a server supports this TLSv1.3 feature, and to what extent, is announced as part of the TLS "session" sent back to curl. Until curl has seen such a session in a previous request, early data cannot be used. </p> <p class="level1">When a new connection is initiated with a known TLSv1.3 session, and that session announced early data support, the first request on this connection is sent <span Class="emphasis">before</span> the TLS handshake is complete. While the early data is also encrypted, it is not protected against replays. An attacker can send your early data to the server again and the server would accept it. </p> <p class="level1">If your request contacts a public server and only retrieves a file, there may be no harm in that. If the first request orders a refrigerator for you, it is probably not a good idea to use early data for it. curl cannot deduce what the security implications of your requests actually are and make this decision for you. </p> <p class="level1"><span Class="bold">WARNING</span>: this option has security implications. See above for more details. </p> <p class="level1">Providing --tls-earlydata multiple times has no extra effect. Disable it again with --no-tls-earlydata. </p> <p class="level1">Example: </p><pre class="level1"> curl --tls-earlydata https://example.com </pre> <p class="level1">Added in 8.11.0. See also <a class="emphasis" href="#--tlsv13">--tlsv1.3</a> and <a class="emphasis" href="#--tls-max">--tls-max</a>. </p> <p class="level0"><a name="--tls-max"></a><span class="nroffip">--tls-max <VERSION></span> </p> <p class="level1">(TLS) VERSION defines maximum supported TLS version. The minimum acceptable version is set by tlsv1.0, tlsv1.1, tlsv1.2 or tlsv1.3. </p> <p class="level1">If the connection is done without TLS, this option has no effect. This includes QUIC-using (HTTP/3) transfers. </p> <p class="level1"><a name="default"></a><span class="nroffip">default</span> </p> <p class="level2">Use up to recommended TLS version. </p> <p class="level1"><a name="10"></a><span class="nroffip">1.0</span> </p> <p class="level2">Use up to TLSv1.0. </p> <p class="level1"><a name="11"></a><span class="nroffip">1.1</span> </p> <p class="level2">Use up to TLSv1.1. </p> <p class="level1"><a name="12"></a><span class="nroffip">1.2</span> </p> <p class="level2">Use up to TLSv1.2. </p> <p class="level1"><a name="13"></a><span class="nroffip">1.3</span> </p> <p class="level2">Use up to TLSv1.3. </p> <p class="level0"><a name=""></a><span class="nroffip"></span> </p> <p class="level1">If --tls-max is provided several times, the last set value is used. </p> <p class="level1">Examples: </p><pre class="level1"> curl --tls-max 1.2 https://example.com curl --tls-max 1.3 --tlsv1.2 https://example.com </pre> <p class="level1"><a class="emphasis" href="#--tls-max">--tls-max</a> requires that libcurl is built to support TLS. See also <a class="emphasis" href="#--tlsv10">--tlsv1.0</a>, <a class="emphasis" href="#--tlsv11">--tlsv1.1</a>, <a class="emphasis" href="#--tlsv12">--tlsv1.2</a> and <a class="emphasis" href="#--tlsv13">--tlsv1.3</a>. </p> <p class="level0"><a name="--tls13-ciphers"></a><span class="nroffip">--tls13-ciphers <list></span> </p> <p class="level1">(TLS) Specifies which cipher suites to use in the connection if it negotiates TLS 1.3. The list of ciphers suites must specify valid ciphers. Read up on TLS 1.3 cipher suite details on this URL: </p> <p class="level1"><a href="https://curl.se/docs/ssl-ciphers.html">https://curl.se/docs/ssl-ciphers.html</a> </p> <p class="level1">This option is used when curl is built to use OpenSSL 1.1.1 or later, wolfSSL, or mbedTLS 3.6.0 or later. </p> <p class="level1">Before curl 8.10.0 with mbedTLS or wolfSSL, TLS 1.3 cipher suites were set by using the <a class="emphasis" href="#--ciphers">--ciphers</a> option. </p> <p class="level1">If --tls13-ciphers is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --tls13-ciphers TLS_AES_128_GCM_SHA256 https://example.com </pre> <p class="level1">Added in 7.61.0. See also <a class="emphasis" href="#--ciphers">--ciphers</a>, <a class="emphasis" href="#--proxy-tls13-ciphers">--proxy-tls13-ciphers</a> and <a class="emphasis" href="#--curves">--curves</a>. </p> <p class="level0"><a name="--tlsauthtype"></a><span class="nroffip">--tlsauthtype <type></span> </p> <p class="level1">(TLS) Set TLS authentication type. Currently, the only supported option is "SRP", for TLS-SRP (<a href="https://www.ietf.org/rfc/rfc5054.txt">RFC 5054</a>). If <a class="emphasis" href="#--tlsuser">--tlsuser</a> and <a class="emphasis" href="#--tlspassword">--tlspassword</a> are specified but <a class="emphasis" href="#--tlsauthtype">--tlsauthtype</a> is not, then this option defaults to "SRP". This option works only if the underlying libcurl is built with TLS-SRP support, which requires OpenSSL or GnuTLS with TLS-SRP support. </p> <p class="level1">If --tlsauthtype is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --tlsauthtype SRP https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--tlsuser">--tlsuser</a>. </p> <p class="level0"><a name="--tlspassword"></a><span class="nroffip">--tlspassword <string></span> </p> <p class="level1">(TLS) Set password to use with the TLS authentication method specified with <a class="emphasis" href="#--tlsauthtype">--tlsauthtype</a>. Requires that <a class="emphasis" href="#--tlsuser">--tlsuser</a> is set. </p> <p class="level1">This option does not work with TLS 1.3. </p> <p class="level1">If --tlspassword is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --tlspassword pwd --tlsuser user https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--tlsuser">--tlsuser</a>. </p> <p class="level0"><a name="--tlsuser"></a><span class="nroffip">--tlsuser <name></span> </p> <p class="level1">(TLS) Set username for use with the TLS authentication method specified with <a class="emphasis" href="#--tlsauthtype">--tlsauthtype</a>. Requires that <a class="emphasis" href="#--tlspassword">--tlspassword</a> also is set. </p> <p class="level1">This option does not work with TLS 1.3. </p> <p class="level1">If --tlsuser is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --tlspassword pwd --tlsuser user https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--tlspassword">--tlspassword</a>. </p> <p class="level0"><a name="-1"></a><span class="nroffip">-1, --tlsv1</span> </p> <p class="level1">(TLS) Use at least TLS version 1.x when negotiating with a remote TLS server. That means TLS version 1.0 or higher </p> <p class="level1">Providing --tlsv1 multiple times has no extra effect. </p> <p class="level1">Example: </p><pre class="level1"> curl --tlsv1 https://example.com </pre> <p class="level1"><a class="emphasis" href="#-1">-1, --tlsv1</a> requires that libcurl is built to support TLS. This option is mutually exclusive with <a class="emphasis" href="#--tlsv11">--tlsv1.1</a>, <a class="emphasis" href="#--tlsv12">--tlsv1.2</a> and <a class="emphasis" href="#--tlsv13">--tlsv1.3</a>. See also <a class="emphasis" href="#--http11">--http1.1</a> and <a class="emphasis" href="#--http2">--http2</a>. </p> <p class="level0"><a name="--tlsv10"></a><span class="nroffip">--tlsv1.0</span> </p> <p class="level1">(TLS) Forces curl to use TLS version 1.0 or later when connecting to a remote TLS server. </p> <p class="level1">In old versions of curl this option was documented to allow _only_ TLS 1.0. That behavior was inconsistent depending on the TLS library. Use <a class="emphasis" href="#--tls-max">--tls-max</a> if you want to set a maximum TLS version. </p> <p class="level1">Providing --tlsv1.0 multiple times has no extra effect. </p> <p class="level1">Example: </p><pre class="level1"> curl --tlsv1.0 https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--tlsv13">--tlsv1.3</a>. </p> <p class="level0"><a name="--tlsv11"></a><span class="nroffip">--tlsv1.1</span> </p> <p class="level1">(TLS) Forces curl to use TLS version 1.1 or later when connecting to a remote TLS server. </p> <p class="level1">In old versions of curl this option was documented to allow _only_ TLS 1.1. That behavior was inconsistent depending on the TLS library. Use <a class="emphasis" href="#--tls-max">--tls-max</a> if you want to set a maximum TLS version. </p> <p class="level1">Providing --tlsv1.1 multiple times has no extra effect. </p> <p class="level1">Example: </p><pre class="level1"> curl --tlsv1.1 https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--tlsv13">--tlsv1.3</a> and <a class="emphasis" href="#--tls-max">--tls-max</a>. </p> <p class="level0"><a name="--tlsv12"></a><span class="nroffip">--tlsv1.2</span> </p> <p class="level1">(TLS) Forces curl to use TLS version 1.2 or later when connecting to a remote TLS server. </p> <p class="level1">In old versions of curl this option was documented to allow _only_ TLS 1.2. That behavior was inconsistent depending on the TLS library. Use <a class="emphasis" href="#--tls-max">--tls-max</a> if you want to set a maximum TLS version. </p> <p class="level1">Providing --tlsv1.2 multiple times has no extra effect. </p> <p class="level1">Example: </p><pre class="level1"> curl --tlsv1.2 https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--tlsv13">--tlsv1.3</a> and <a class="emphasis" href="#--tls-max">--tls-max</a>. </p> <p class="level0"><a name="--tlsv13"></a><span class="nroffip">--tlsv1.3</span> </p> <p class="level1">(TLS) Forces curl to use TLS version 1.3 or later when connecting to a remote TLS server. </p> <p class="level1">If the connection is done without TLS, this option has no effect. This includes QUIC-using (HTTP/3) transfers. </p> <p class="level1">Note that TLS 1.3 is not supported by all TLS backends. </p> <p class="level1">Providing --tlsv1.3 multiple times has no extra effect. </p> <p class="level1">Example: </p><pre class="level1"> curl --tlsv1.3 https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--tlsv12">--tlsv1.2</a> and <a class="emphasis" href="#--tls-max">--tls-max</a>. </p> <p class="level0"><a name="--tr-encoding"></a><span class="nroffip">--tr-encoding</span> </p> <p class="level1">(HTTP) Request a compressed Transfer-Encoding response using one of the algorithms curl supports, and uncompress the data while receiving it. </p> <p class="level1">Providing --tr-encoding multiple times has no extra effect. Disable it again with --no-tr-encoding. </p> <p class="level1">Example: </p><pre class="level1"> curl --tr-encoding https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--compressed">--compressed</a>. </p> <p class="level0"><a name="--trace"></a><span class="nroffip">--trace <file></span> </p> <p class="level1">Save a full trace dump of all incoming and outgoing data, including descriptive information, in the given output file. Use "-" as filename to have the output sent to stdout. Use "%" as filename to have the output sent to stderr. </p> <p class="level1">Note that verbose output of curl activities and network traffic might contain sensitive data, including usernames, credentials or secret data content. Be aware and be careful when sharing trace logs with others. </p> <p class="level1">This option is global and does not need to be specified for each use of --next. </p> <p class="level1">If --trace is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --trace log.txt https://example.com </pre> <p class="level1">This option is mutually exclusive with <a class="emphasis" href="#-v">-v, --verbose</a> and <a class="emphasis" href="#--trace-ascii">--trace-ascii</a>. See also <a class="emphasis" href="#--trace-ascii">--trace-ascii</a>, <a class="emphasis" href="#--trace-config">--trace-config</a>, <a class="emphasis" href="#--trace-ids">--trace-ids</a> and <a class="emphasis" href="#--trace-time">--trace-time</a>. </p> <p class="level0"><a name="--trace-ascii"></a><span class="nroffip">--trace-ascii <file></span> </p> <p class="level1">Save a full trace dump of all incoming and outgoing data, including descriptive information, in the given output file. Use "-" as filename to have the output sent to stdout. Use "%" as filename to send the output to stderr. </p> <p class="level1">This is similar to <a class="emphasis" href="#--trace">--trace</a>, but leaves out the hex part and only shows the ASCII part of the dump. It makes smaller output that might be easier to read for untrained humans. </p> <p class="level1">Note that verbose output of curl activities and network traffic might contain sensitive data, including usernames, credentials or secret data content. Be aware and be careful when sharing trace logs with others. </p> <p class="level1">This option is global and does not need to be specified for each use of --next. </p> <p class="level1">If --trace-ascii is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --trace-ascii log.txt https://example.com </pre> <p class="level1">This option is mutually exclusive with <a class="emphasis" href="#--trace">--trace</a> and <a class="emphasis" href="#-v">-v, --verbose</a>. See also <a class="emphasis" href="#-v">-v, --verbose</a> and <a class="emphasis" href="#--trace">--trace</a>. </p> <p class="level0"><a name="--trace-config"></a><span class="nroffip">--trace-config <string></span> </p> <p class="level1">Set configuration for trace output. A comma-separated list of components where detailed output can be made available from. Names are case-insensitive. Specify 'all' to enable all trace components. </p> <p class="level1">In addition to trace component names, specify "ids" and "time" to avoid extra <a class="emphasis" href="#--trace-ids">--trace-ids</a> or <a class="emphasis" href="#--trace-time">--trace-time</a> parameters. </p> <p class="level1">See the <span Class="emphasis">curl_global_trace(3)</span> man page for more details. </p> <p class="level1">This option is global and does not need to be specified for each use of --next. </p> <p class="level1">--trace-config can be used several times in a command line </p> <p class="level1">Example: </p><pre class="level1"> curl --trace-config ids,http/2 https://example.com </pre> <p class="level1">Added in 8.3.0. See also <a class="emphasis" href="#-v">-v, --verbose</a> and <a class="emphasis" href="#--trace">--trace</a>. </p> <p class="level0"><a name="--trace-ids"></a><span class="nroffip">--trace-ids</span> </p> <p class="level1">Prepends the transfer and connection identifiers to each trace or verbose line that curl displays. </p> <p class="level1">This option is global and does not need to be specified for each use of --next. </p> <p class="level1">Providing --trace-ids multiple times has no extra effect. Disable it again with --no-trace-ids. </p> <p class="level1">Example: </p><pre class="level1"> curl --trace-ids --trace-ascii output https://example.com </pre> <p class="level1">Added in 8.2.0. See also <a class="emphasis" href="#--trace">--trace</a> and <a class="emphasis" href="#-v">-v, --verbose</a>. </p> <p class="level0"><a name="--trace-time"></a><span class="nroffip">--trace-time</span> </p> <p class="level1">Prepends a time stamp to each trace or verbose line that curl displays. </p> <p class="level1">This option is global and does not need to be specified for each use of --next. </p> <p class="level1">Providing --trace-time multiple times has no extra effect. Disable it again with --no-trace-time. </p> <p class="level1">Example: </p><pre class="level1"> curl --trace-time --trace-ascii output https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--trace">--trace</a> and <a class="emphasis" href="#-v">-v, --verbose</a>. </p> <p class="level0"><a name="--unix-socket"></a><span class="nroffip">--unix-socket <path></span> </p> <p class="level1">(HTTP) Connect through this Unix domain socket, instead of using the network. </p> <p class="level1">If --unix-socket is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --unix-socket socket-path https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#--abstract-unix-socket">--abstract-unix-socket</a>. </p> <p class="level0"><a name="-T"></a><span class="nroffip">-T, --upload-file <file></span> </p> <p class="level1">Upload the specified local file to the remote URL. </p> <p class="level1">If there is no file part in the specified URL, curl appends the local file name to the end of the URL before the operation starts. You must use a trailing slash (/) on the last directory to prove to curl that there is no filename or curl thinks that your last directory name is the remote filename to use. </p> <p class="level1">When putting the local filename at the end of the URL, curl ignores what is on the left side of any slash (/) or backslash (\) used in the filename and only appends what is on the right side of the rightmost such character. </p> <p class="level1">Use the filename "-" (a single dash) to use stdin instead of a given file. Alternately, the filename "." (a single period) may be specified instead of "-" to use stdin in non-blocking mode to allow reading server output while stdin is being uploaded. </p> <p class="level1">If this option is used with an HTTP(S) URL, the PUT method is used. </p> <p class="level1">You can specify one <a class="emphasis" href="#-T">-T, --upload-file</a> for each URL on the command line. Each <a class="emphasis" href="#-T">-T, --upload-file</a> + URL pair specifies what to upload and to where. curl also supports globbing of the <a class="emphasis" href="#-T">-T, --upload-file</a> argument, meaning that you can upload multiple files to a single URL by using the same URL globbing style supported in the URL. </p> <p class="level1">When uploading to an SMTP server: the uploaded data is assumed to be <a href="https://www.ietf.org/rfc/rfc5322.txt">RFC 5322</a> formatted. It has to feature the necessary set of headers and mail body formatted correctly by the user as curl does not transcode nor encode it further in any way. </p> <p class="level1">--upload-file is associated with a single URL. Use it once per URL when you use several URLs in a command line. </p> <p class="level1">Examples: </p><pre class="level1"> curl -T file https://example.com curl -T "img[1-1000].png" ftp://ftp.example.com/ curl --upload-file "{file1,file2}" https://example.com curl -T file -T file2 https://example.com https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-G">-G, --get</a>, <a class="emphasis" href="#-I">-I, --head</a>, <a class="emphasis" href="#-X">-X, --request</a> and <a class="emphasis" href="#-d">-d, --data</a>. </p> <p class="level0"><a name="--url"></a><span class="nroffip">--url <url></span> </p> <p class="level1">Specify a URL to fetch or send data to. </p> <p class="level1">If the given URL is missing a scheme (such as "<a href="http://"">http://"</a> or "<a href="ftp://"">ftp://"</a> etc) curl guesses which scheme to use based on the hostname. If the outermost subdomain name matches DICT, FTP, IMAP, LDAP, POP3 or SMTP case insensitively, then that protocol is used, otherwise it assumes HTTP. Scheme guessing can be avoided by providing a full URL including the scheme, or disabled by setting a default protocol, see <a class="emphasis" href="#--proto-default">--proto-default</a> for details. </p> <p class="level1">To control where the contents of a retrieved URL is written instead of the default stdout, use the <a class="emphasis" href="#-o">-o, --output</a> or the <a class="emphasis" href="#-O">-O, --remote-name</a> options. When retrieving multiple URLs in a single invoke, each provided URL needs its own dedicated destination option unless <a class="emphasis" href="#--remote-name-all">--remote-name-all</a> is used. </p> <p class="level1">On Windows, "file://" accesses can be converted to network accesses by the operating system. </p> <p class="level1">--url can be used several times in a command line </p> <p class="level1">Example: </p><pre class="level1"> curl --url https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-">-:, --next</a> and <a class="emphasis" href="#-K">-K, --config</a>. </p> <p class="level0"><a name="--url-query"></a><span class="nroffip">--url-query <data></span> </p> <p class="level1">(all) Add a piece of data, usually a name + value pair, to the end of the URL query part. The syntax is identical to that used for <a class="emphasis" href="#--data-urlencode">--data-urlencode</a> with one extension: </p> <p class="level1">If the argument starts with a '+' (plus), the rest of the string is provided as-is unencoded. </p> <p class="level1">The query part of a URL is the one following the question mark on the right end. </p> <p class="level1">--url-query can be used several times in a command line </p> <p class="level1">Examples: </p><pre class="level1"> curl --url-query name=val https://example.com curl --url-query =encodethis http://example.net/foo curl --url-query name@file https://example.com curl --url-query @fileonly https://example.com curl --url-query "+name=%20foo" https://example.com </pre> <p class="level1">Added in 7.87.0. See also <a class="emphasis" href="#--data-urlencode">--data-urlencode</a> and <a class="emphasis" href="#-G">-G, --get</a>. </p> <p class="level0"><a name="-B"></a><span class="nroffip">-B, --use-ascii</span> </p> <p class="level1">(FTP LDAP) Enable ASCII transfer mode. For FTP, this can also be enforced by using a URL that ends with ";type=A". This option causes data sent to stdout to be in text mode for Win32 systems. </p> <p class="level1">Providing --use-ascii multiple times has no extra effect. Disable it again with --no-use-ascii. </p> <p class="level1">Example: </p><pre class="level1"> curl -B ftp://example.com/README </pre> <p class="level1">See also <a class="emphasis" href="#--crlf">--crlf</a> and <a class="emphasis" href="#--data-ascii">--data-ascii</a>. </p> <p class="level0"><a name="-u"></a><span class="nroffip">-u, --user <user:password></span> </p> <p class="level1">Specify the username and password to use for server authentication. Overrides <a class="emphasis" href="#-n">-n, --netrc</a> and <a class="emphasis" href="#--netrc-optional">--netrc-optional</a>. </p> <p class="level1">If you simply specify the username, curl prompts for a password. </p> <p class="level1">The username and passwords are split up on the first colon, which makes it impossible to use a colon in the username with this option. The password can, still. </p> <p class="level1">On systems where it works, curl hides the given option argument from process listings. This is not enough to protect credentials from possibly getting seen by other users on the same system as they still are visible for a moment before cleared. Such sensitive data should be retrieved from a file instead or similar and never used in clear text in a command line. </p> <p class="level1">When using Kerberos V5 with a Windows based server you should include the Windows domain name in the username, in order for the server to successfully obtain a Kerberos Ticket. If you do not, then the initial authentication handshake may fail. </p> <p class="level1">When using NTLM, the username can be specified simply as the username, without the domain, if there is a single domain and forest in your setup for example. </p> <p class="level1">To specify the domain name use either Down-Level Logon Name or UPN (User Principal Name) formats. For example, EXAMPLE\user and user@example.com respectively. </p> <p class="level1">If you use a Windows SSPI-enabled curl binary and perform Kerberos V5, Negotiate, NTLM or Digest authentication then you can tell curl to select the username and password from your environment by specifying a single colon with this option: "-u :". </p> <p class="level1">If --user is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl -u user:secret https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-n">-n, --netrc</a> and <a class="emphasis" href="#-K">-K, --config</a>. </p> <p class="level0"><a name="-A"></a><span class="nroffip">-A, --user-agent <name></span> </p> <p class="level1">(HTTP) Specify the User-Agent string to send to the HTTP server. To encode blanks in the string, surround the string with single quote marks. This header can also be set with the <a class="emphasis" href="#-H">-H, --header</a> or the <a class="emphasis" href="#--proxy-header">--proxy-header</a> options. </p> <p class="level1">If you give an empty argument to <a class="emphasis" href="#-A">-A, --user-agent</a> (""), it removes the header completely from the request. If you prefer a blank header, you can set it to a single space (" "). </p> <p class="level1">By default, curl uses curl/VERSION, such as User-Agent: curl/8.11.1. </p> <p class="level1">If --user-agent is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl -A "Agent 007" https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-H">-H, --header</a> and <a class="emphasis" href="#--proxy-header">--proxy-header</a>. </p> <p class="level0"><a name="--variable"></a><span class="nroffip">--variable <[%]name=text/@file></span> </p> <p class="level1">Set a variable with "name=content" or "name@file" (where "file" can be stdin if set to a single dash ("-")). The name is a case sensitive identifier that must consist of no other letters than a-z, A-Z, 0-9 or underscore. The specified content is then associated with this identifier. </p> <p class="level1">Setting the same variable name again overwrites the old contents with the new. </p> <p class="level1">The contents of a variable can be referenced in a later command line option when that option name is prefixed with "<span Class="emphasis">--expand-</span>", and the name is used as "{{name}}". </p> <p class="level1"><a class="emphasis" href="#--variable">--variable</a> can import environment variables into the name space. Opt to either require the environment variable to be set or provide a default value for the variable in case it is not already set. </p> <p class="level1"><a class="emphasis" href="#--variable">--variable</a> %name imports the variable called "name" but exits with an error if that environment variable is not already set. To provide a default value if the environment variable is not set, use <a class="emphasis" href="#--variable">--variable</a> %name=content or <a class="emphasis" href="#--variable">--variable</a> %name@content. Note that on some systems - but not all - environment variables are case insensitive. </p> <p class="level1">When expanding variables, curl supports a set of functions that can make the variable contents more convenient to use. You apply a function to a variable expansion by adding a colon and then list the desired functions in a comma-separated list that is evaluated in a left-to-right order. Variable content holding null bytes that are not encoded when expanded, causes an error. </p> <p class="level1">Available functions: </p> <p class="level1"><a name="trim"></a><span class="nroffip">trim</span> </p> <p class="level2">removes all leading and trailing white space. </p> <p class="level1"><a name="json"></a><span class="nroffip">json</span> </p> <p class="level2">outputs the content using JSON string quoting rules. </p> <p class="level1"><a name="url"></a><span class="nroffip">url</span> </p> <p class="level2">shows the content URL (percent) encoded. </p> <p class="level1"><a name="b64"></a><span class="nroffip">b64</span> </p> <p class="level2">expands the variable base64 encoded </p> <p class="level0"><a name=""></a><span class="nroffip"></span> </p> <p class="level1">--variable can be used several times in a command line </p> <p class="level1">Example: </p><pre class="level1"> curl --variable name=smith --expand-url "https://example.com/{{name}}" </pre> <p class="level1">Added in 8.3.0. See also <a class="emphasis" href="#-K">-K, --config</a>. </p> <p class="level0"><a name="-v"></a><span class="nroffip">-v, --verbose</span> </p> <p class="level1">Makes curl verbose during the operation. Useful for debugging and seeing what's going on under the hood. A line starting with > means header data sent by curl, < means header data received by curl that is hidden in normal cases, and a line starting with * means additional info provided by curl. </p> <p class="level1">If you only want HTTP headers in the output, <a class="emphasis" href="#-i">-i, --show-headers</a> or <a class="emphasis" href="#-D">-D, --dump-header</a> might be more suitable options. </p> <p class="level1">Since curl 8.10, mentioning this option several times in the same argument increases the level of the trace output. However, as before, a single <a class="emphasis" href="#-v">-v, --verbose</a> or <span Class="emphasis">--no-verbose</span> reverts any additions by previous "-vv" again. This means that "-vv -v" is equivalent to a single -v. This avoids unwanted verbosity when the option is mentioned in the command line <span Class="emphasis">and</span> curl config files. </p> <p class="level1">Using it twice, e.g. "-vv", outputs time (<a class="emphasis" href="#--trace-time">--trace-time</a>) and transfer ids (<a class="emphasis" href="#--trace-ids">--trace-ids</a>), as well as enable tracing for all protocols (<a class="emphasis" href="#--trace-config">--trace-config</a> protocol). </p> <p class="level1">Adding a third verbose outputs transfer content (<a class="emphasis" href="#--trace-ascii">--trace-ascii</a> %) and enable tracing of more components (<a class="emphasis" href="#--trace-config">--trace-config</a> read,write,ssl). </p> <p class="level1">A forth time adds tracing of all network components. (<a class="emphasis" href="#--trace-config">--trace-config</a> network). </p> <p class="level1">Any addition of the verbose option after that has no effect. </p> <p class="level1">If you think this option does not give you the right details, consider using <a class="emphasis" href="#--trace">--trace</a> or <a class="emphasis" href="#--trace-ascii">--trace-ascii</a> instead. Or use it only once and use <a class="emphasis" href="#--trace-config">--trace-config</a> to trace the specific components you wish to see. </p> <p class="level1">Note that verbose output of curl activities and network traffic might contain sensitive data, including usernames, credentials or secret data content. Be aware and be careful when sharing trace logs with others. </p> <p class="level1">This option is global and does not need to be specified for each use of --next. </p> <p class="level1">Providing --verbose multiple times has no extra effect. Disable it again with --no-verbose. </p> <p class="level1">Example: </p><pre class="level1"> curl --verbose https://example.com </pre> <p class="level1">This option is mutually exclusive with <a class="emphasis" href="#--trace">--trace</a> and <a class="emphasis" href="#--trace-ascii">--trace-ascii</a>. See also <a class="emphasis" href="#-i">-i, --show-headers</a>, <a class="emphasis" href="#-s">-s, --silent</a>, <a class="emphasis" href="#--trace">--trace</a> and <a class="emphasis" href="#--trace-ascii">--trace-ascii</a>. </p> <p class="level0"><a name="-V"></a><span class="nroffip">-V, --version</span> </p> <p class="level1">Displays information about curl and the libcurl version it uses. </p> <p class="level1">The first line includes the full version of curl, libcurl and other 3rd party libraries linked with the executable. </p> <p class="level1">The second line (starts with "Release-Date:") shows the release date. </p> <p class="level1">The third line (starts with "Protocols:") shows all protocols that libcurl reports to support. </p> <p class="level1">The fourth line (starts with "Features:") shows specific features libcurl reports to offer. Available features include: </p> <p class="level1"><a name="alt-svc"></a><span class="nroffip">alt-svc</span> </p> <p class="level2">Support for the Alt-Svc: header is provided. </p> <p class="level1"><a name="AsynchDNS"></a><span class="nroffip">AsynchDNS</span> </p> <p class="level2">This curl uses asynchronous name resolves. Asynchronous name resolves can be done using either the c-ares or the threaded resolver backends. </p> <p class="level1"><a name="brotli"></a><span class="nroffip">brotli</span> </p> <p class="level2">Support for automatic brotli compression over HTTP(S). </p> <p class="level1"><a name="CharConv"></a><span class="nroffip">CharConv</span> </p> <p class="level2">curl was built with support for character set conversions (like EBCDIC) </p> <p class="level1"><a name="Debug"></a><span class="nroffip">Debug</span> </p> <p class="level2">This curl uses a libcurl built with Debug. This enables more error-tracking and memory debugging etc. For curl-developers only. </p> <p class="level1"><a name="ECH"></a><span class="nroffip">ECH</span> </p> <p class="level2">ECH support is present. </p> <p class="level1"><a name="gsasl"></a><span class="nroffip">gsasl</span> </p> <p class="level2">The built-in SASL authentication includes extensions to support SCRAM because libcurl was built with libgsasl. </p> <p class="level1"><a name="GSS-API"></a><span class="nroffip">GSS-API</span> </p> <p class="level2">GSS-API is supported. </p> <p class="level1"><a name="HSTS"></a><span class="nroffip">HSTS</span> </p> <p class="level2">HSTS support is present. </p> <p class="level1"><a name="HTTP2"></a><span class="nroffip">HTTP2</span> </p> <p class="level2">HTTP/2 support has been built-in. </p> <p class="level1"><a name="HTTP3"></a><span class="nroffip">HTTP3</span> </p> <p class="level2">HTTP/3 support has been built-in. </p> <p class="level1"><a name="HTTPS-proxy"></a><span class="nroffip">HTTPS-proxy</span> </p> <p class="level2">This curl is built to support HTTPS proxy. </p> <p class="level1"><a name="IDN"></a><span class="nroffip">IDN</span> </p> <p class="level2">This curl supports IDN - international domain names. </p> <p class="level1"><a name="IPv6"></a><span class="nroffip">IPv6</span> </p> <p class="level2">You can use IPv6 with this. </p> <p class="level1"><a name="Kerberos"></a><span class="nroffip">Kerberos</span> </p> <p class="level2">Kerberos V5 authentication is supported. </p> <p class="level1"><a name="Largefile"></a><span class="nroffip">Largefile</span> </p> <p class="level2">This curl supports transfers of large files, files larger than 2GB. </p> <p class="level1"><a name="libz"></a><span class="nroffip">libz</span> </p> <p class="level2">Automatic decompression (via gzip, deflate) of compressed files over HTTP is supported. </p> <p class="level1"><a name="MultiSSL"></a><span class="nroffip">MultiSSL</span> </p> <p class="level2">This curl supports multiple TLS backends. </p> <p class="level1"><a name="NTLM"></a><span class="nroffip">NTLM</span> </p> <p class="level2">NTLM authentication is supported. </p> <p class="level1"><a name="NTLMWB"></a><span class="nroffip">NTLM_WB</span> </p> <p class="level2">NTLM delegation to winbind helper is supported. This feature was removed from curl in 8.8.0. </p> <p class="level1"><a name="PSL"></a><span class="nroffip">PSL</span> </p> <p class="level2">PSL is short for Public Suffix List and means that this curl has been built with knowledge about "public suffixes". </p> <p class="level1"><a name="SPNEGO"></a><span class="nroffip">SPNEGO</span> </p> <p class="level2">SPNEGO authentication is supported. </p> <p class="level1"><a name="SSL"></a><span class="nroffip">SSL</span> </p> <p class="level2">SSL versions of various protocols are supported, such as HTTPS, FTPS, POP3S and so on. </p> <p class="level1"><a name="SSPI"></a><span class="nroffip">SSPI</span> </p> <p class="level2">SSPI is supported. </p> <p class="level1"><a name="TLS-SRP"></a><span class="nroffip">TLS-SRP</span> </p> <p class="level2">SRP (Secure Remote Password) authentication is supported for TLS. </p> <p class="level1"><a name="TrackMemory"></a><span class="nroffip">TrackMemory</span> </p> <p class="level2">Debug memory tracking is supported. </p> <p class="level1"><a name="Unicode"></a><span class="nroffip">Unicode</span> </p> <p class="level2">Unicode support on Windows. </p> <p class="level1"><a name="UnixSockets"></a><span class="nroffip">UnixSockets</span> </p> <p class="level2">Unix sockets support is provided. </p> <p class="level1"><a name="zstd"></a><span class="nroffip">zstd</span> </p> <p class="level2">Automatic decompression (via zstd) of compressed files over HTTP is supported. </p> <p class="level0"><a name=""></a><span class="nroffip"></span> </p> <p class="level1">Example: </p><pre class="level1"> curl --version </pre> <p class="level1">See also <a class="emphasis" href="#-h">-h, --help</a> and <a class="emphasis" href="#-M">-M, --manual</a>. </p> <p class="level0"><a name="--vlan-priority"></a><span class="nroffip">--vlan-priority <priority></span> </p> <p class="level1">(All) Set VLAN priority as defined in IEEE 802.1Q. </p> <p class="level1">This field is set on Ethernet level, and only works within a local network. </p> <p class="level1">The valid range for <priority> is 0 to 7. </p> <p class="level1">If --vlan-priority is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl --vlan-priority 4 https://example.com </pre> <p class="level1">Added in 8.9.0. See also <a class="emphasis" href="#--ip-tos">--ip-tos</a>. </p> <p class="level0"><a name="-w"></a><span class="nroffip">-w, --write-out <format></span> </p> <p class="level1">Make curl display information on stdout after a completed transfer. The format is a string that may contain plain text mixed with any number of variables. The format can be specified as a literal "string", or you can have curl read the format from a file with "@filename" and to tell curl to read the format from stdin you write "@-". </p> <p class="level1">The variables present in the output format are substituted by the value or text that curl thinks fit, as described below. All variables are specified as %{variable_name} and to output a normal % you just write them as %%. You can output a newline by using \n, a carriage return with \r and a tab space with \t. </p> <p class="level1">The output is by default written to standard output, but can be changed with %{stderr} and %output{}. </p> <p class="level1">Output HTTP headers from the most recent request by using <span Class="emphasis">%header{name}</span> where <span Class="emphasis">name</span> is the case insensitive name of the header (without the trailing colon). The header contents are exactly as sent over the network, with leading and trailing whitespace trimmed (added in 7.84.0). </p> <p class="level1">Select a specific target destination file to write the output to, by using <span Class="emphasis">%output{name}</span> (added in curl 8.3.0) where <span Class="emphasis">name</span> is the full filename. The output following that instruction is then written to that file. More than one <span Class="emphasis">%output{}</span> instruction can be specified in the same write-out argument. If the filename cannot be created, curl leaves the output destination to the one used prior to the <span Class="emphasis">%output{}</span> instruction. Use <span Class="emphasis">%output{>>name}</span> to append data to an existing file. </p> <p class="level1">This output is done independently of if the file transfer was successful or not. </p> <p class="level1">If the specified action or output specified with this option fails in any way, it does not make curl return a (different) error. </p> <p class="level1"><span Class="bold">NOTE:</span> On Windows, the %-symbol is a special symbol used to expand environment variables. In batch files, all occurrences of % must be doubled when using this option to properly escape. If this option is used at the command prompt then the % cannot be escaped and unintended expansion is possible. </p> <p class="level1">The variables available are: </p> <p class="level1"><a name="certs"></a><span class="nroffip">certs</span> </p> <p class="level2">Output the certificate chain with details. Supported only by the OpenSSL, GnuTLS, Schannel and Secure Transport backends. (Added in 7.88.0) </p> <p class="level1"><a name="connid"></a><span class="nroffip">conn_id</span> </p> <p class="level2">The connection identifier last used by the transfer. The connection id is unique number among all connections using the same connection cache. (Added in 8.2.0) </p> <p class="level1"><a name="contenttype"></a><span class="nroffip">content_type</span> </p> <p class="level2">The Content-Type of the requested document, if there was any. </p> <p class="level1"><a name="errormsg"></a><span class="nroffip">errormsg</span> </p> <p class="level2">The error message. (Added in 7.75.0) </p> <p class="level1"><a name="exitcode"></a><span class="nroffip">exitcode</span> </p> <p class="level2">The numerical exit code of the transfer. (Added in 7.75.0) </p> <p class="level1"><a name="filenameeffective"></a><span class="nroffip">filename_effective</span> </p> <p class="level2">The ultimate filename that curl writes out to. This is only meaningful if curl is told to write to a file with the <a class="emphasis" href="#-O">-O, --remote-name</a> or <a class="emphasis" href="#-o">-o, --output</a> option. It is most useful in combination with the <a class="emphasis" href="#-J">-J, --remote-header-name</a> option. </p> <p class="level1"><a name="ftpentrypath"></a><span class="nroffip">ftp_entry_path</span> </p> <p class="level2">The initial path curl ended up in when logging on to the remote FTP server. </p> <p class="level1"><a name="headerjson"></a><span class="nroffip">header_json</span> </p> <p class="level2">A JSON object with all HTTP response headers from the recent transfer. Values are provided as arrays, since in the case of multiple headers there can be multiple values. (Added in 7.83.0) </p> <p class="level2">The header names provided in lowercase, listed in order of appearance over the wire. Except for duplicated headers. They are grouped on the first occurrence of that header, each value is presented in the JSON array. </p> <p class="level1"><a name="httpcode"></a><span class="nroffip">http_code</span> </p> <p class="level2">The numerical response code that was found in the last retrieved HTTP(S) or FTP(s) transfer. </p> <p class="level1"><a name="httpconnect"></a><span class="nroffip">http_connect</span> </p> <p class="level2">The numerical code that was found in the last response (from a proxy) to a curl CONNECT request. </p> <p class="level1"><a name="httpversion"></a><span class="nroffip">http_version</span> </p> <p class="level2">The http version that was effectively used. </p> <p class="level1"><a name="json"></a><span class="nroffip">json</span> </p> <p class="level2">A JSON object with all available keys. (Added in 7.70.0) </p> <p class="level1"><a name="localip"></a><span class="nroffip">local_ip</span> </p> <p class="level2">The IP address of the local end of the most recently done connection - can be either IPv4 or IPv6. </p> <p class="level1"><a name="localport"></a><span class="nroffip">local_port</span> </p> <p class="level2">The local port number of the most recently done connection. </p> <p class="level1"><a name="method"></a><span class="nroffip">method</span> </p> <p class="level2">The http method used in the most recent HTTP request. (Added in 7.72.0) </p> <p class="level1"><a name="numcerts"></a><span class="nroffip">num_certs</span> </p> <p class="level2">Number of server certificates received in the TLS handshake. Supported only by the OpenSSL, GnuTLS, Schannel and Secure Transport backends. (Added in 7.88.0) </p> <p class="level1"><a name="numconnects"></a><span class="nroffip">num_connects</span> </p> <p class="level2">Number of new connects made in the recent transfer. </p> <p class="level1"><a name="numheaders"></a><span class="nroffip">num_headers</span> </p> <p class="level2">The number of response headers in the most recent request (restarted at each redirect). Note that the status line IS NOT a header. (Added in 7.73.0) </p> <p class="level1"><a name="numredirects"></a><span class="nroffip">num_redirects</span> </p> <p class="level2">Number of redirects that were followed in the request. </p> <p class="level1"><a name="numretries"></a><span class="nroffip">num_retries</span> </p> <p class="level2">Number of retries actually performed when "<a class="emphasis" href="#--retry">--retry</a>" has been used. (Added in 8.9.0) </p> <p class="level1"><a name="onerror"></a><span class="nroffip">onerror</span> </p> <p class="level2">The rest of the output is only shown if the transfer returned a non-zero error. (Added in 7.75.0) </p> <p class="level1"><a name="proxysslverifyresult"></a><span class="nroffip">proxy_ssl_verify_result</span> </p> <p class="level2">The result of the HTTPS proxy's SSL peer certificate verification that was requested. 0 means the verification was successful. </p> <p class="level1"><a name="proxyused"></a><span class="nroffip">proxy_used</span> </p> <p class="level2">Returns 1 if the previous transfer used a proxy, otherwise 0. Useful to for example determine if a "NOPROXY" pattern matched the hostname or not. (Added in 8.7.0) </p> <p class="level1"><a name="redirecturl"></a><span class="nroffip">redirect_url</span> </p> <p class="level2">When an HTTP request was made without <a class="emphasis" href="#-L">-L, --location</a> to follow redirects (or when <a class="emphasis" href="#--max-redirs">--max-redirs</a> is met), this variable shows the actual URL a redirect <span Class="emphasis">would</span> have gone to. </p> <p class="level1"><a name="referer"></a><span class="nroffip">referer</span> </p> <p class="level2">The Referer: header, if there was any. (Added in 7.76.0) </p> <p class="level1"><a name="remoteip"></a><span class="nroffip">remote_ip</span> </p> <p class="level2">The remote IP address of the most recently done connection - can be either IPv4 or IPv6. </p> <p class="level1"><a name="remoteport"></a><span class="nroffip">remote_port</span> </p> <p class="level2">The remote port number of the most recently done connection. </p> <p class="level1"><a name="responsecode"></a><span class="nroffip">response_code</span> </p> <p class="level2">The numerical response code that was found in the last transfer (formerly known as "http_code"). </p> <p class="level1"><a name="scheme"></a><span class="nroffip">scheme</span> </p> <p class="level2">The URL scheme (sometimes called protocol) that was effectively used. </p> <p class="level1"><a name="sizedownload"></a><span class="nroffip">size_download</span> </p> <p class="level2">The total amount of bytes that were downloaded. This is the size of the body/data that was transferred, excluding headers. </p> <p class="level1"><a name="sizeheader"></a><span class="nroffip">size_header</span> </p> <p class="level2">The total amount of bytes of the downloaded headers. </p> <p class="level1"><a name="sizerequest"></a><span class="nroffip">size_request</span> </p> <p class="level2">The total amount of bytes that were sent in the HTTP request. </p> <p class="level1"><a name="sizeupload"></a><span class="nroffip">size_upload</span> </p> <p class="level2">The total amount of bytes that were uploaded. This is the size of the body/data that was transferred, excluding headers. </p> <p class="level1"><a name="speeddownload"></a><span class="nroffip">speed_download</span> </p> <p class="level2">The average download speed that curl measured for the complete download. Bytes per second. </p> <p class="level1"><a name="speedupload"></a><span class="nroffip">speed_upload</span> </p> <p class="level2">The average upload speed that curl measured for the complete upload. Bytes per second. </p> <p class="level1"><a name="sslverifyresult"></a><span class="nroffip">ssl_verify_result</span> </p> <p class="level2">The result of the SSL peer certificate verification that was requested. 0 means the verification was successful. </p> <p class="level1"><a name="stderr"></a><span class="nroffip">stderr</span> </p> <p class="level2">From this point on, the <a class="emphasis" href="#-w">-w, --write-out</a> output is written to standard error. (Added in 7.63.0) </p> <p class="level1"><a name="stdout"></a><span class="nroffip">stdout</span> </p> <p class="level2">From this point on, the <a class="emphasis" href="#-w">-w, --write-out</a> output is written to standard output. This is the default, but can be used to switch back after switching to stderr. (Added in 7.63.0) </p> <p class="level1"><a name="timeappconnect"></a><span class="nroffip">time_appconnect</span> </p> <p class="level2">The time, in seconds, it took from the start until the SSL/SSH/etc connect/handshake to the remote host was completed. </p> <p class="level1"><a name="timeconnect"></a><span class="nroffip">time_connect</span> </p> <p class="level2">The time, in seconds, it took from the start until the TCP connect to the remote host (or proxy) was completed. </p> <p class="level1"><a name="timenamelookup"></a><span class="nroffip">time_namelookup</span> </p> <p class="level2">The time, in seconds, it took from the start until the name resolving was completed. </p> <p class="level1"><a name="timeposttransfer"></a><span class="nroffip">time_posttransfer</span> </p> <p class="level2">The time it took from the start until the last byte is sent by libcurl. In microseconds. (Added in 8.10.0) </p> <p class="level1"><a name="timepretransfer"></a><span class="nroffip">time_pretransfer</span> </p> <p class="level2">The time, in seconds, it took from the start until the file transfer was just about to begin. This includes all pre-transfer commands and negotiations that are specific to the particular protocol(s) involved. </p> <p class="level1"><a name="timeredirect"></a><span class="nroffip">time_redirect</span> </p> <p class="level2">The time, in seconds, it took for all redirection steps including name lookup, connect, pretransfer and transfer before the final transaction was started. "time_redirect" shows the complete execution time for multiple redirections. </p> <p class="level1"><a name="timestarttransfer"></a><span class="nroffip">time_starttransfer</span> </p> <p class="level2">The time, in seconds, it took from the start until the first byte is received. This includes time_pretransfer and also the time the server needed to calculate the result. </p> <p class="level1"><a name="timetotal"></a><span class="nroffip">time_total</span> </p> <p class="level2">The total time, in seconds, that the full operation lasted. </p> <p class="level1"><a name="url"></a><span class="nroffip">url</span> </p> <p class="level2">The URL that was fetched. (Added in 7.75.0) </p> <p class="level1"><a name="urlscheme"></a><span class="nroffip">url.scheme</span> </p> <p class="level2">The scheme part of the URL that was fetched. (Added in 8.1.0) </p> <p class="level1"><a name="urluser"></a><span class="nroffip">url.user</span> </p> <p class="level2">The user part of the URL that was fetched. (Added in 8.1.0) </p> <p class="level1"><a name="urlpassword"></a><span class="nroffip">url.password</span> </p> <p class="level2">The password part of the URL that was fetched. (Added in 8.1.0) </p> <p class="level1"><a name="urloptions"></a><span class="nroffip">url.options</span> </p> <p class="level2">The options part of the URL that was fetched. (Added in 8.1.0) </p> <p class="level1"><a name="urlhost"></a><span class="nroffip">url.host</span> </p> <p class="level2">The host part of the URL that was fetched. (Added in 8.1.0) </p> <p class="level1"><a name="urlport"></a><span class="nroffip">url.port</span> </p> <p class="level2">The port number of the URL that was fetched. If no port number was specified and the URL scheme is known, that scheme's default port number is shown. (Added in 8.1.0) </p> <p class="level1"><a name="urlpath"></a><span class="nroffip">url.path</span> </p> <p class="level2">The path part of the URL that was fetched. (Added in 8.1.0) </p> <p class="level1"><a name="urlquery"></a><span class="nroffip">url.query</span> </p> <p class="level2">The query part of the URL that was fetched. (Added in 8.1.0) </p> <p class="level1"><a name="urlfragment"></a><span class="nroffip">url.fragment</span> </p> <p class="level2">The fragment part of the URL that was fetched. (Added in 8.1.0) </p> <p class="level1"><a name="urlzoneid"></a><span class="nroffip">url.zoneid</span> </p> <p class="level2">The zone id part of the URL that was fetched. (Added in 8.1.0) </p> <p class="level1"><a name="urlescheme"></a><span class="nroffip">urle.scheme</span> </p> <p class="level2">The scheme part of the effective (last) URL that was fetched. (Added in 8.1.0) </p> <p class="level1"><a name="urleuser"></a><span class="nroffip">urle.user</span> </p> <p class="level2">The user part of the effective (last) URL that was fetched. (Added in 8.1.0) </p> <p class="level1"><a name="urlepassword"></a><span class="nroffip">urle.password</span> </p> <p class="level2">The password part of the effective (last) URL that was fetched. (Added in 8.1.0) </p> <p class="level1"><a name="urleoptions"></a><span class="nroffip">urle.options</span> </p> <p class="level2">The options part of the effective (last) URL that was fetched. (Added in 8.1.0) </p> <p class="level1"><a name="urlehost"></a><span class="nroffip">urle.host</span> </p> <p class="level2">The host part of the effective (last) URL that was fetched. (Added in 8.1.0) </p> <p class="level1"><a name="urleport"></a><span class="nroffip">urle.port</span> </p> <p class="level2">The port number of the effective (last) URL that was fetched. If no port number was specified, but the URL scheme is known, that scheme's default port number is shown. (Added in 8.1.0) </p> <p class="level1"><a name="urlepath"></a><span class="nroffip">urle.path</span> </p> <p class="level2">The path part of the effective (last) URL that was fetched. (Added in 8.1.0) </p> <p class="level1"><a name="urlequery"></a><span class="nroffip">urle.query</span> </p> <p class="level2">The query part of the effective (last) URL that was fetched. (Added in 8.1.0) </p> <p class="level1"><a name="urlefragment"></a><span class="nroffip">urle.fragment</span> </p> <p class="level2">The fragment part of the effective (last) URL that was fetched. (Added in 8.1.0) </p> <p class="level1"><a name="urlezoneid"></a><span class="nroffip">urle.zoneid</span> </p> <p class="level2">The zone id part of the effective (last) URL that was fetched. (Added in 8.1.0) </p> <p class="level1"><a name="urlnum"></a><span class="nroffip">urlnum</span> </p> <p class="level2">The URL index number of this transfer, 0-indexed. Unglobbed URLs share the same index number as the origin globbed URL. (Added in 7.75.0) </p> <p class="level1"><a name="urleffective"></a><span class="nroffip">url_effective</span> </p> <p class="level2">The URL that was fetched last. This is most meaningful if you have told curl to follow location: headers. </p> <p class="level1"><a name="xferid"></a><span class="nroffip">xfer_id</span> </p> <p class="level2">The numerical identifier of the last transfer done. -1 if no transfer has been started yet for the handle. The transfer id is unique among all transfers performed using the same connection cache. (Added in 8.2.0) </p> <p class="level0"><a name=""></a><span class="nroffip"></span> </p> <p class="level1">If --write-out is provided several times, the last set value is used. </p> <p class="level1">Example: </p><pre class="level1"> curl -w '%{response_code}\n' https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-v">-v, --verbose</a> and <a class="emphasis" href="#-I">-I, --head</a>. </p> <p class="level0"><a name="--xattr"></a><span class="nroffip">--xattr</span> </p> <p class="level1">When saving output to a file, tell curl to store file metadata in extended file attributes. Currently, "curl" is stored in the "creator" attribute, the URL is stored in the "xdg.origin.url" attribute and, for HTTP, the content type is stored in the "mime_type" attribute. If the file system does not support extended attributes, a warning is issued. </p> <p class="level1">Providing --xattr multiple times has no extra effect. Disable it again with --no-xattr. </p> <p class="level1">Example: </p><pre class="level1"> curl --xattr -o storage https://example.com </pre> <p class="level1">See also <a class="emphasis" href="#-R">-R, --remote-time</a>, <a class="emphasis" href="#-w">-w, --write-out</a> and <a class="emphasis" href="#-v">-v, --verbose</a>. </p><a name="FILES"></a><h2 class="nroffsh">Files</h2> <p class="level0"><span Class="emphasis">~/.curlrc</span> </p> <p class="level0">Default config file, see <a class="emphasis" href="#-K">-K, --config</a> for details. </p><a name="ENVIRONMENT"></a><h2 class="nroffsh">Environment</h2> <p class="level0">The environment variables can be specified in lower case or upper case. The lower case version has precedence. "http_proxy" is an exception as it is only available in lower case. </p> <p class="level0">Using an environment variable to set the proxy has the same effect as using the <a class="emphasis" href="#-x">-x, --proxy</a> option. </p> <p class="level0"><a name="httpproxy"></a><span class="nroffip">http_proxy [protocol://]<host>[:port]</span> </p> <p class="level1">Sets the proxy server to use for HTTP. </p> <p class="level0"><a name="HTTPSPROXY"></a><span class="nroffip">HTTPS_PROXY [protocol://]<host>[:port]</span> </p> <p class="level1">Sets the proxy server to use for HTTPS. </p> <p class="level0"><a name="url-protocolPROXY"></a><span class="nroffip">[url-protocol]_PROXY [protocol://]<host>[:port]</span> </p> <p class="level1">Sets the proxy server to use for [url-protocol], where the protocol is a protocol that curl supports and as specified in a URL. FTP, FTPS, POP3, IMAP, SMTP, LDAP, etc. </p> <p class="level0"><a name="ALLPROXY"></a><span class="nroffip">ALL_PROXY [protocol://]<host>[:port]</span> </p> <p class="level1">Sets the proxy server to use if no protocol-specific proxy is set. </p> <p class="level0"><a name="NOPROXY"></a><span class="nroffip">NO_PROXY <comma-separated list of hosts/domains></span> </p> <p class="level1">list of hostnames that should not go through any proxy. If set to an asterisk '*' only, it matches all hosts. Each name in this list is matched as either a domain name which contains the hostname, or the hostname itself. </p> <p class="level1">This environment variable disables use of the proxy even when specified with the <a class="emphasis" href="#-x">-x, --proxy</a> option. That is </p><pre class="level1"> NO_PROXY=direct.example.com curl -x http://proxy.example.com http://direct.example.com </pre> <p class="level1">accesses the target URL directly, and </p><pre class="level1"> NO_PROXY=direct.example.com curl -x http://proxy.example.com http://somewhere.example.com </pre> <p class="level1">accesses the target URL through the proxy. </p> <p class="level1">The list of hostnames can also be include numerical IP addresses, and IPv6 versions should then be given without enclosing brackets. </p> <p class="level1">IP addresses can be specified using CIDR notation: an appended slash and number specifies the number of "network bits" out of the address to use in the comparison (added in 7.86.0). For example "192.168.0.0/16" would match all addresses starting with "192.168". </p> <p class="level0"><a name="APPDATA"></a><span class="nroffip">APPDATA <dir></span> </p> <p class="level1">On Windows, this variable is used when trying to find the home directory. If the primary home variable are all unset. </p> <p class="level0"><a name="COLUMNS"></a><span class="nroffip">COLUMNS <terminal width></span> </p> <p class="level1">If set, the specified number of characters is used as the terminal width when the alternative progress-bar is shown. If not set, curl tries to figure it out using other ways. </p> <p class="level0"><a name="CURLCABUNDLE"></a><span class="nroffip">CURL_CA_BUNDLE <file></span> </p> <p class="level1">If set, it is used as the <a class="emphasis" href="#--cacert">--cacert</a> value. This environment variable is ignored if Schannel is used as the TLS backend. </p> <p class="level0"><a name="CURLHOME"></a><span class="nroffip">CURL_HOME <dir></span> </p> <p class="level1">If set, is the first variable curl checks when trying to find its home directory. If not set, it continues to check <a class="emphasis" href="#XDGCONFIGHOME">XDG_CONFIG_HOME</a> </p> <p class="level0"><a name="CURLSSLBACKEND"></a><span class="nroffip">CURL_SSL_BACKEND <TLS backend></span> </p> <p class="level1">If curl was built with support for "MultiSSL", meaning that it has built-in support for more than one TLS backend, this environment variable can be set to the case insensitive name of the particular backend to use when curl is invoked. Setting a name that is not a built-in alternative makes curl stay with the default. </p> <p class="level1">SSL backend names (case-insensitive): <span Class="bold">bearssl</span>, <span Class="bold">gnutls</span>, <span Class="bold">mbedtls</span>, <span Class="bold">openssl</span>, <span Class="bold">rustls</span>, <span Class="bold">schannel</span>, <span Class="bold">secure-transport</span>, <span Class="bold">wolfssl</span> </p> <p class="level0"><a name="HOME"></a><span class="nroffip">HOME <dir></span> </p> <p class="level1">If set, this is used to find the home directory when that is needed. Like when looking for the default .curlrc. <a class="emphasis" href="#CURLHOME">CURL_HOME</a> and <a class="emphasis" href="#XDGCONFIGHOME">XDG_CONFIG_HOME</a> have preference. </p> <p class="level0"><a name="QLOGDIR"></a><span class="nroffip">QLOGDIR <directory name></span> </p> <p class="level1">If curl was built with HTTP/3 support, setting this environment variable to a local directory makes curl produce <span Class="bold">qlogs</span> in that directory, using file names named after the destination connection id (in hex). Do note that these files can become rather large. Works with the ngtcp2 and quiche QUIC backends. </p> <p class="level0"><a name="SHELL"></a><span class="nroffip">SHELL</span> </p> <p class="level1">Used on VMS when trying to detect if using a <span Class="bold">DCL</span> or a <span Class="bold">Unix</span> shell. </p> <p class="level0"><a name="SSLCERTDIR"></a><span class="nroffip">SSL_CERT_DIR <dir></span> </p> <p class="level1">If set, it is used as the <a class="emphasis" href="#--capath">--capath</a> value. This environment variable is ignored if Schannel is used as the TLS backend. </p> <p class="level0"><a name="SSLCERTFILE"></a><span class="nroffip">SSL_CERT_FILE <path></span> </p> <p class="level1">If set, it is used as the <a class="emphasis" href="#--cacert">--cacert</a> value. This environment variable is ignored if Schannel is used as the TLS backend. </p> <p class="level0"><a name="SSLKEYLOGFILE"></a><span class="nroffip">SSLKEYLOGFILE <filename></span> </p> <p class="level1">If you set this environment variable to a filename, curl stores TLS secrets from its connections in that file when invoked to enable you to analyze the TLS traffic in real time using network analyzing tools such as Wireshark. This works with the following TLS backends: OpenSSL, LibreSSL (TLS 1.2 max), BoringSSL, GnuTLS and wolfSSL. </p> <p class="level0"><a name="USERPROFILE"></a><span class="nroffip">USERPROFILE <dir></span> </p> <p class="level1">On Windows, this variable is used when trying to find the home directory. If the other, primary, variable are all unset. If set, curl uses the path <span Class="bold">"$USERPROFILE\Application Data"</span>. </p> <p class="level0"><a name="XDGCONFIGHOME"></a><span class="nroffip">XDG_CONFIG_HOME <dir></span> </p> <p class="level1">If <a class="emphasis" href="#CURLHOME">CURL_HOME</a> is not set, this variable is checked when looking for a default .curlrc file. </p><a name="PROXY"></a><h2 class="nroffsh">Proxy protocol prefixes</h2> <p class="level0">The proxy string may be specified with a protocol:// prefix to specify alternative proxy protocols. </p> <p class="level0">If no protocol is specified in the proxy string or if the string does not match a supported one, the proxy is treated as an HTTP proxy. </p> <p class="level0">The supported proxy protocol prefixes are as follows: </p> <p class="level0"><a name="http"></a><span class="nroffip">http://</span> </p> <p class="level1">Makes it use it as an HTTP proxy. The default if no scheme prefix is used. </p> <p class="level0"><a name="https"></a><span class="nroffip">https://</span> </p> <p class="level1">Makes it treated as an <a class="bold" href="#HTTPS">HTTPS</a> proxy. </p> <p class="level0"><a name="socks4"></a><span class="nroffip">socks4://</span> </p> <p class="level1">Makes it the equivalent of <a class="emphasis" href="#--socks4">--socks4</a> </p> <p class="level0"><a name="socks4a"></a><span class="nroffip">socks4a://</span> </p> <p class="level1">Makes it the equivalent of <a class="emphasis" href="#--socks4a">--socks4a</a> </p> <p class="level0"><a name="socks5"></a><span class="nroffip">socks5://</span> </p> <p class="level1">Makes it the equivalent of <a class="emphasis" href="#--socks5">--socks5</a> </p> <p class="level0"><a name="socks5h"></a><span class="nroffip">socks5h://</span> </p> <p class="level1">Makes it the equivalent of <a class="emphasis" href="#--socks5-hostname">--socks5-hostname</a> </p><a name="EXIT"></a><h2 class="nroffsh">Exit codes</h2> <p class="level0">There are a bunch of different error codes and their corresponding error messages that may appear under error conditions. At the time of this writing, the exit codes are: </p> <p class="level0"><a name="0"></a><span class="nroffip">0</span> </p> <p class="level1">Success. The operation completed successfully according to the instructions. </p> <p class="level0"><a name="1"></a><span class="nroffip">1</span> </p> <p class="level1">Unsupported protocol. This build of curl has no support for this protocol. </p> <p class="level0"><a name="2"></a><span class="nroffip">2</span> </p> <p class="level1">Failed to initialize. </p> <p class="level0"><a name="3"></a><span class="nroffip">3</span> </p> <p class="level1">URL malformed. The syntax was not correct. </p> <p class="level0"><a name="4"></a><span class="nroffip">4</span> </p> <p class="level1">A feature or option that was needed to perform the desired request was not enabled or was explicitly disabled at build-time. To make curl able to do this, you probably need another build of libcurl. </p> <p class="level0"><a name="5"></a><span class="nroffip">5</span> </p> <p class="level1">Could not resolve proxy. The given proxy host could not be resolved. </p> <p class="level0"><a name="6"></a><span class="nroffip">6</span> </p> <p class="level1">Could not resolve host. The given remote host could not be resolved. </p> <p class="level0"><a name="7"></a><span class="nroffip">7</span> </p> <p class="level1">Failed to connect to host. </p> <p class="level0"><a name="8"></a><span class="nroffip">8</span> </p> <p class="level1">Weird server reply. The server sent data curl could not parse. </p> <p class="level0"><a name="9"></a><span class="nroffip">9</span> </p> <p class="level1">FTP access denied. The server denied login or denied access to the particular resource or directory you wanted to reach. Most often you tried to change to a directory that does not exist on the server. </p> <p class="level0"><a name="10"></a><span class="nroffip">10</span> </p> <p class="level1">FTP accept failed. While waiting for the server to connect back when an active FTP session is used, an error code was sent over the control connection or similar. </p> <p class="level0"><a name="11"></a><span class="nroffip">11</span> </p> <p class="level1">FTP weird PASS reply. Curl could not parse the reply sent to the PASS request. </p> <p class="level0"><a name="12"></a><span class="nroffip">12</span> </p> <p class="level1">During an active FTP session while waiting for the server to connect back to curl, the timeout expired. </p> <p class="level0"><a name="13"></a><span class="nroffip">13</span> </p> <p class="level1">FTP weird PASV reply, Curl could not parse the reply sent to the PASV request. </p> <p class="level0"><a name="14"></a><span class="nroffip">14</span> </p> <p class="level1">FTP weird 227 format. Curl could not parse the 227-line the server sent. </p> <p class="level0"><a name="15"></a><span class="nroffip">15</span> </p> <p class="level1">FTP cannot use host. Could not resolve the host IP we got in the 227-line. </p> <p class="level0"><a name="16"></a><span class="nroffip">16</span> </p> <p class="level1">HTTP/2 error. A problem was detected in the HTTP2 framing layer. This is somewhat generic and can be one out of several problems, see the error message for details. </p> <p class="level0"><a name="17"></a><span class="nroffip">17</span> </p> <p class="level1">FTP could not set binary. Could not change transfer method to binary. </p> <p class="level0"><a name="18"></a><span class="nroffip">18</span> </p> <p class="level1">Partial file. Only a part of the file was transferred. </p> <p class="level0"><a name="19"></a><span class="nroffip">19</span> </p> <p class="level1">FTP could not download/access the given file, the RETR (or similar) command failed. </p> <p class="level0"><a name="21"></a><span class="nroffip">21</span> </p> <p class="level1">FTP quote error. A quote command returned error from the server. </p> <p class="level0"><a name="22"></a><span class="nroffip">22</span> </p> <p class="level1">HTTP page not retrieved. The requested URL was not found or returned another error with the HTTP error code being 400 or above. This return code only appears if <a class="emphasis" href="#-f">-f, --fail</a> is used. </p> <p class="level0"><a name="23"></a><span class="nroffip">23</span> </p> <p class="level1">Write error. Curl could not write data to a local filesystem or similar. </p> <p class="level0"><a name="25"></a><span class="nroffip">25</span> </p> <p class="level1">Failed starting the upload. For FTP, the server typically denied the STOR command. </p> <p class="level0"><a name="26"></a><span class="nroffip">26</span> </p> <p class="level1">Read error. Various reading problems. </p> <p class="level0"><a name="27"></a><span class="nroffip">27</span> </p> <p class="level1">Out of memory. A memory allocation request failed. </p> <p class="level0"><a name="28"></a><span class="nroffip">28</span> </p> <p class="level1">Operation timeout. The specified time-out period was reached according to the conditions. </p> <p class="level0"><a name="30"></a><span class="nroffip">30</span> </p> <p class="level1">FTP PORT failed. The PORT command failed. Not all FTP servers support the PORT command, try doing a transfer using PASV instead. </p> <p class="level0"><a name="31"></a><span class="nroffip">31</span> </p> <p class="level1">FTP could not use REST. The REST command failed. This command is used for resumed FTP transfers. </p> <p class="level0"><a name="33"></a><span class="nroffip">33</span> </p> <p class="level1">HTTP range error. The range "command" did not work. </p> <p class="level0"><a name="34"></a><span class="nroffip">34</span> </p> <p class="level1">HTTP post error. Internal post-request generation error. </p> <p class="level0"><a name="35"></a><span class="nroffip">35</span> </p> <p class="level1">SSL connect error. The SSL handshaking failed. </p> <p class="level0"><a name="36"></a><span class="nroffip">36</span> </p> <p class="level1">Bad download resume. Could not continue an earlier aborted download. </p> <p class="level0"><a name="37"></a><span class="nroffip">37</span> </p> <p class="level1">FILE could not read file. Failed to open the file. Permissions? </p> <p class="level0"><a name="38"></a><span class="nroffip">38</span> </p> <p class="level1">LDAP cannot bind. LDAP bind operation failed. </p> <p class="level0"><a name="39"></a><span class="nroffip">39</span> </p> <p class="level1">LDAP search failed. </p> <p class="level0"><a name="41"></a><span class="nroffip">41</span> </p> <p class="level1">Function not found. A required LDAP function was not found. </p> <p class="level0"><a name="42"></a><span class="nroffip">42</span> </p> <p class="level1">Aborted by callback. An application told curl to abort the operation. </p> <p class="level0"><a name="43"></a><span class="nroffip">43</span> </p> <p class="level1">Internal error. A function was called with a bad parameter. </p> <p class="level0"><a name="45"></a><span class="nroffip">45</span> </p> <p class="level1">Interface error. A specified outgoing interface could not be used. </p> <p class="level0"><a name="47"></a><span class="nroffip">47</span> </p> <p class="level1">Too many redirects. When following redirects, curl hit the maximum amount. </p> <p class="level0"><a name="48"></a><span class="nroffip">48</span> </p> <p class="level1">Unknown option specified to libcurl. This indicates that you passed a weird option to curl that was passed on to libcurl and rejected. Read up in the manual. </p> <p class="level0"><a name="49"></a><span class="nroffip">49</span> </p> <p class="level1">Malformed telnet option. </p> <p class="level0"><a name="52"></a><span class="nroffip">52</span> </p> <p class="level1">The server did not reply anything, which here is considered an error. </p> <p class="level0"><a name="53"></a><span class="nroffip">53</span> </p> <p class="level1">SSL crypto engine not found. </p> <p class="level0"><a name="54"></a><span class="nroffip">54</span> </p> <p class="level1">Cannot set SSL crypto engine as default. </p> <p class="level0"><a name="55"></a><span class="nroffip">55</span> </p> <p class="level1">Failed sending network data. </p> <p class="level0"><a name="56"></a><span class="nroffip">56</span> </p> <p class="level1">Failure in receiving network data. </p> <p class="level0"><a name="58"></a><span class="nroffip">58</span> </p> <p class="level1">Problem with the local certificate. </p> <p class="level0"><a name="59"></a><span class="nroffip">59</span> </p> <p class="level1">Could not use specified SSL cipher. </p> <p class="level0"><a name="60"></a><span class="nroffip">60</span> </p> <p class="level1">Peer certificate cannot be authenticated with known CA certificates. </p> <p class="level0"><a name="61"></a><span class="nroffip">61</span> </p> <p class="level1">Unrecognized transfer encoding. </p> <p class="level0"><a name="63"></a><span class="nroffip">63</span> </p> <p class="level1">Maximum file size exceeded. </p> <p class="level0"><a name="64"></a><span class="nroffip">64</span> </p> <p class="level1">Requested FTP SSL level failed. </p> <p class="level0"><a name="65"></a><span class="nroffip">65</span> </p> <p class="level1">Sending the data requires a rewind that failed. </p> <p class="level0"><a name="66"></a><span class="nroffip">66</span> </p> <p class="level1">Failed to initialize SSL Engine. </p> <p class="level0"><a name="67"></a><span class="nroffip">67</span> </p> <p class="level1">The username, password, or similar was not accepted and curl failed to log in. </p> <p class="level0"><a name="68"></a><span class="nroffip">68</span> </p> <p class="level1">File not found on TFTP server. </p> <p class="level0"><a name="69"></a><span class="nroffip">69</span> </p> <p class="level1">Permission problem on TFTP server. </p> <p class="level0"><a name="70"></a><span class="nroffip">70</span> </p> <p class="level1">Out of disk space on TFTP server. </p> <p class="level0"><a name="71"></a><span class="nroffip">71</span> </p> <p class="level1">Illegal TFTP operation. </p> <p class="level0"><a name="72"></a><span class="nroffip">72</span> </p> <p class="level1">Unknown TFTP transfer ID. </p> <p class="level0"><a name="73"></a><span class="nroffip">73</span> </p> <p class="level1">File already exists (TFTP). </p> <p class="level0"><a name="74"></a><span class="nroffip">74</span> </p> <p class="level1">No such user (TFTP). </p> <p class="level0"><a name="77"></a><span class="nroffip">77</span> </p> <p class="level1">Problem reading the SSL CA cert (path? access rights?). </p> <p class="level0"><a name="78"></a><span class="nroffip">78</span> </p> <p class="level1">The resource referenced in the URL does not exist. </p> <p class="level0"><a name="79"></a><span class="nroffip">79</span> </p> <p class="level1">An unspecified error occurred during the SSH session. </p> <p class="level0"><a name="80"></a><span class="nroffip">80</span> </p> <p class="level1">Failed to shut down the SSL connection. </p> <p class="level0"><a name="82"></a><span class="nroffip">82</span> </p> <p class="level1">Could not load CRL file, missing or wrong format. </p> <p class="level0"><a name="83"></a><span class="nroffip">83</span> </p> <p class="level1">Issuer check failed. </p> <p class="level0"><a name="84"></a><span class="nroffip">84</span> </p> <p class="level1">The FTP PRET command failed. </p> <p class="level0"><a name="85"></a><span class="nroffip">85</span> </p> <p class="level1">Mismatch of RTSP CSeq numbers. </p> <p class="level0"><a name="86"></a><span class="nroffip">86</span> </p> <p class="level1">Mismatch of RTSP Session Identifiers. </p> <p class="level0"><a name="87"></a><span class="nroffip">87</span> </p> <p class="level1">Unable to parse FTP file list. </p> <p class="level0"><a name="88"></a><span class="nroffip">88</span> </p> <p class="level1">FTP chunk callback reported error. </p> <p class="level0"><a name="89"></a><span class="nroffip">89</span> </p> <p class="level1">No connection available, the session is queued. </p> <p class="level0"><a name="90"></a><span class="nroffip">90</span> </p> <p class="level1">SSL public key does not matched pinned public key. </p> <p class="level0"><a name="91"></a><span class="nroffip">91</span> </p> <p class="level1">Invalid SSL certificate status. </p> <p class="level0"><a name="92"></a><span class="nroffip">92</span> </p> <p class="level1">Stream error in HTTP/2 framing layer. </p> <p class="level0"><a name="93"></a><span class="nroffip">93</span> </p> <p class="level1">An API function was called from inside a callback. </p> <p class="level0"><a name="94"></a><span class="nroffip">94</span> </p> <p class="level1">An authentication function returned an error. </p> <p class="level0"><a name="95"></a><span class="nroffip">95</span> </p> <p class="level1">A problem was detected in the HTTP/3 layer. This is somewhat generic and can be one out of several problems, see the error message for details. </p> <p class="level0"><a name="96"></a><span class="nroffip">96</span> </p> <p class="level1">QUIC connection error. This error may be caused by an SSL library error. QUIC is the protocol used for HTTP/3 transfers. </p> <p class="level0"><a name="97"></a><span class="nroffip">97</span> </p> <p class="level1">Proxy handshake error. </p> <p class="level0"><a name="98"></a><span class="nroffip">98</span> </p> <p class="level1">A client-side certificate is required to complete the TLS handshake. </p> <p class="level0"><a name="99"></a><span class="nroffip">99</span> </p> <p class="level1">Poll or select returned fatal error. </p> <p class="level0"><a name="100"></a><span class="nroffip">100</span> </p> <p class="level1">A value or data field grew larger than allowed. </p> <p class="level0"><a name="XX"></a><span class="nroffip">XX</span> </p> <p class="level1">More error codes might appear here in future releases. The existing ones are meant to never change. </p><a name="BUGS"></a><h2 class="nroffsh">Bugs</h2> <p class="level0">If you experience any problems with curl, submit an issue in the project's bug tracker on GitHub: <a href="https://github.com/curl/curl/issues">https://github.com/curl/curl/issues</a> </p><a name="AUTHORS"></a><h2 class="nroffsh">Authors</h2> <p class="level0">Daniel Stenberg is the main author, but the whole list of contributors is found in the separate THANKS file. </p><a name="WWW"></a><h2 class="nroffsh">Www</h2> <p class="level0"><a href="https://curl.se">https://curl.se</a> </p><a name="SEE"></a><h2 class="nroffsh">See also</h2> <p class="level0"><span Class="bold">ftp (1)</span>, <span Class="bold">wget (1)</span> </p><p class="roffit"> This HTML page was made with <a href="https://daniel.haxx.se/projects/roffit/">roffit</a>. </div> </div> </body> </html>