📄 curl.html
字号:
<p class="level1">(HTTP) Request a compressed response using one of the algorithms libcurl supports, and return the uncompressed document. If this option is used and the server sends an unsupported encoding, Curl will report an error. <p class="level1">If this option is used several times, each occurrence will toggle it on/off. <p class="level0"><a name="--connect-timeout"></a><span class="nroffip">--connect-timeout <seconds></span> <p class="level1">Maximum time in seconds that you allow the connection to the server to take. This only limits the connection phase, once curl has connected this option is of no more use. See also the <a class="emphasis" href="#-m--max-time">-m/--max-time</a> option. <p class="level1">If this option is used several times, the last one will be used. <p class="level0"><a name="-c--cookie-jar"></a><span class="nroffip">-c/--cookie-jar <file name></span> <p class="level1">Specify to which file you want curl to write all cookies after a completed operation. Curl writes all cookies previously read from a specified file as well as all cookies received from remote server(s). If no cookies are known, no file will be written. The file will be written using the Netscape cookie file format. If you set the file name to a single dash, "-", the cookies will be written to stdout. <p class="level1"><span Class="bold">NOTE</span> If the cookie jar can't be created or written to, the whole curl operation won't fail or even report an error clearly. Using -v will get a warning displayed, but that is the only visible feedback you get about this possibly lethal situation. <p class="level1">If this option is used several times, the last specified file name will be used. <p class="level0"><a name="-C--continue-at"></a><span class="nroffip">-C/--continue-at <offset></span> <p class="level1">Continue/Resume a previous file transfer at the given offset. The given offset is the exact number of bytes that will be skipped counted from the beginning of the source file before it is transferred to the destination. If used with uploads, the ftp server command SIZE will not be used by curl. <p class="level1">Use "-C -" to tell curl to automatically find out where/how to resume the transfer. It then uses the given output/input files to figure that out. <p class="level1">If this option is used several times, the last one will be used. <p class="level0"><a name="--create-dirs"></a><span class="nroffip">--create-dirs</span> <p class="level1">When used in conjunction with the -o option, curl will create the necessary local directory hierarchy as needed. This option creates the dirs mentioned with the -o option, nothing else. If the -o file name uses no dir or if the dirs it mentions already exist, no dir will be created. <p class="level1">To create remote directories when using FTP, try <a class="emphasis" href="#--ftp-create-dirs">--ftp-create-dirs</a>. <p class="level0"><a name="--crlf"></a><span class="nroffip">--crlf</span> <p class="level1">(FTP) Convert LF to CRLF in upload. Useful for MVS (OS/390). <p class="level1">If this option is used several times, the following occurrences make no difference. <p class="level0"><a name="-d--data"></a><span class="nroffip">-d/--data <data></span> <p class="level1">(HTTP) Sends the specified data in a POST request to the HTTP server, in a way that can emulate as if a user has filled in a HTML form and pressed the submit button. Note that the data is sent exactly as specified with no extra processing (with all newlines cut off). The data is expected to be "url-encoded". This will cause curl to pass the data to the server using the content-type application/x-www-form-urlencoded. Compare to <a class="emphasis" href="#-F--form">-F/--form</a>. If this option is used more than once on the same command line, the data pieces specified will be merged together with a separating &-letter. Thus, using '-d name=daniel -d skill=lousy' would generate a post chunk that looks like 'name=daniel&skill=lousy'. <p class="level1">If you start the data with the letter @, the rest should be a file name to read the data from, or - if you want curl to read the data from stdin. The contents of the file must already be url-encoded. Multiple files can also be specified. Posting data from a file named 'foobar' would thus be done with <span Class="emphasis">--data</span> @foobar". <p class="level1">To post data purely binary, you should instead use the <a class="emphasis" href="#--data-binary">--data-binary</a> option. <p class="level1"><a class="emphasis" href="#-d--data">-d/--data</a> is the same as <a class="emphasis" href="#--data-ascii">--data-ascii</a>. <p class="level1">If this option is used several times, the ones following the first will append data. <p class="level0"><a name="--data-ascii"></a><span class="nroffip">--data-ascii <data></span> <p class="level1">(HTTP) This is an alias for the <a class="emphasis" href="#-d--data">-d/--data</a> option. <p class="level1">If this option is used several times, the ones following the first will append data. <p class="level0"><a name="--data-binary"></a><span class="nroffip">--data-binary <data></span> <p class="level1">(HTTP) This posts data in a similar manner as <a class="emphasis" href="#--data-ascii">--data-ascii</a> does, although when using this option the entire context of the posted data is kept as-is. If you want to post a binary file without the strip-newlines feature of the <a class="emphasis" href="#--data-ascii">--data-ascii</a> option, this is for you. <p class="level1">If this option is used several times, the ones following the first will append data. <p class="level0"><a name="--digest"></a><span class="nroffip">--digest</span> <p class="level1">(HTTP) Enables HTTP Digest authentication. This is a authentication that prevents the password from being sent over the wire in clear text. Use this in combination with the normal <a class="emphasis" href="#-u--user">-u/--user</a> option to set user name and password. See also <a class="emphasis" href="#--ntlm">--ntlm</a>, <a class="emphasis" href="#--negotiate">--negotiate</a> and <a class="emphasis" href="#--anyauth">--anyauth</a> for related options. <p class="level1">If this option is used several times, the following occurrences make no difference. <p class="level0"><a name="--disable-eprt"></a><span class="nroffip">--disable-eprt</span> <p class="level1">(FTP) Tell curl to disable the use of the EPRT and LPRT commands when doing active FTP transfers. Curl will normally always first attempt to use EPRT, then LPRT before using PORT, but with this option, it will use PORT right away. EPRT and LPRT are extensions to the original FTP protocol, may not work on all servers but enable more functionality in a better way than the traditional PORT command. <p class="level1">If this option is used several times, each occurrence will toggle this on/off. <p class="level0"><a name="--disable-epsv"></a><span class="nroffip">--disable-epsv</span> <p class="level1">(FTP) Tell curl to disable the use of the EPSV command when doing passive FTP transfers. Curl will normally always first attempt to use EPSV before PASV, but with this option, it will not try using EPSV. <p class="level1">If this option is used several times, each occurrence will toggle this on/off. <p class="level0"><a name="-D--dump-header"></a><span class="nroffip">-D/--dump-header <file></span> <p class="level1">Write the protocol headers to the specified file. <p class="level1">This option is handy to use when you want to store the headers that a HTTP site sends to you. Cookies from the headers could then be read in a second curl invoke by using the <a class="emphasis" href="#-b--cookie">-b/--cookie</a> option! The <a class="emphasis" href="#-c--cookie-jar">-c/--cookie-jar</a> option is however a better way to store cookies. <p class="level1">When used on FTP, the ftp server response lines are considered being "headers" and thus are saved there. <p class="level1">If this option is used several times, the last one will be used. <p class="level0"><a name="-e--referer"></a><span class="nroffip">-e/--referer <URL></span> <p class="level1">(HTTP) Sends the "Referer Page" information to the HTTP server. This can also be set with the <a class="emphasis" href="#-H--header">-H/--header</a> flag of course. When used with <a class="emphasis" href="#-L--location">-L/--location</a> you can append ";auto" to the --referer 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 don't set an initial --referer. <p class="level1">If this option is used several times, the last one will be used. <p class="level0"><a name="--engine"></a><span class="nroffip">--engine <name></span> <p class="level1">Select the OpenSSL crypto engine to use for cipher operations. Use <a class="emphasis" href="#--engine">--engine list</a> to print a list of build-time supported engines. Note that not all (or none) of the engines may be available at run-time. <p class="level0"><a name="--environment"></a><span class="nroffip">--environment</span> <p class="level1">(RISC OS ONLY) Sets a range of environment variables, using the names the -w option supports, to easier allow extraction of useful information after having run curl. <p class="level1">If this option is used several times, each occurrence will toggle this on/off. <p class="level0"><a name="--egd-file"></a><span class="nroffip">--egd-file <file></span> <p class="level1">(HTTPS) Specify the path name to the Entropy Gathering Daemon socket. The socket is used to seed the random engine for SSL connections. See also the <a class="emphasis" href="#--random-file">--random-file</a> option. <p class="level0"><a name="-E--cert"></a><span class="nroffip">-E/--cert <certificate[:password]></span> <p class="level1">(HTTPS) Tells curl to use the specified certificate file when getting a file with HTTPS. The certificate must be in PEM format. If the optional password isn't specified, it will be queried for on the terminal. Note that this certificate is the private key and the private certificate concatenated! <p class="level1">If this option is used several times, the last one will be used. <p class="level0"><a name="--cert-type"></a><span class="nroffip">--cert-type <type></span> <p class="level1">(SSL) Tells curl what certificate type the provided certificate is in. PEM, DER and ENG are recognized types. <p class="level1">If this option is used several times, the last one will be used. <p class="level0"><a name="--cacert"></a><span class="nroffip">--cacert <CA certificate></span> <p class="level1">(HTTPS) Tells curl to use the specified certificate file to verify the peer. The file may contain multiple CA certificates. The certificate(s) must be in PEM format. <p class="level1">curl recognizes the environment variable named 'CURL_CA_BUNDLE' if that is set, and uses the given path as a path to a CA cert bundle. This option overrides that variable. <p class="level1">The windows version of curl will automatically look 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 class="level1">If this option is used several times, the last one will be used. <p class="level0"><a name="--capath"></a><span class="nroffip">--capath <CA certificate directory></span> <p class="level1">(HTTPS) Tells curl to use the specified certificate directory to verify the peer. The certificates must be in PEM format, and the directory must have been processed using the c_rehash utility supplied with openssl. Using <a class="emphasis" href="#--capath">--capath</a> can allow curl to make https 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 class="level1">If this option is used several times, the last one will be used. <p class="level0"><a name="-f--fail"></a><span class="nroffip">-f/--fail</span> <p class="level1">(HTTP) Fail silently (no output at all) on server errors. This is mostly done like this to better enable scripts etc to better deal with failed attempts. In normal cases when a HTTP server fails to deliver a document, it returns an HTML document stating so (which often also describes why and more). This flag will prevent curl from outputting that and return error 22. <p class="level1">If this option is used twice, the second will again disable silent failure. <p class="level0"><a name="--ftp-account"></a><span class="nroffip">--ftp-account [data]</span> <p class="level1">(FTP) When an FTP server asks for "account data" after user name and password has been provided, this data is sent off using the ACCT command. (Added in 7.13.0) <p class="level1">If this option is used twice, the second will override the previous use. <p class="level0"><a name="--ftp-create-dirs"></a><span class="nroffip">--ftp-create-dirs</span> <p class="level1">(FTP) When an FTP URL/operation uses a path that doesn't currently exist on the server, the standard behavior of curl is to fail. Using this option, curl will instead attempt to create missing directories. <p class="level1">If this option is used twice, the second will again disable directory creation. <p class="level0"><a name="--ftp-method"></a><span class="nroffip">--ftp-method [method]</span> <p class="level1">(FTP) Control what method curl should use to reach a file on a FTP(S) server. The method argument should be one of the following alternatives: <p class="level2"><p class="level1"><a name="multicwd"></a><span class="nroffip">multicwd</span> <p class="level2">curl does a single CWD operation for each path part in the given URL. For deep hierarchies this means very many commands. This is how RFC1738 says it should be done. This is the default but the slowest behavior. <p class="level1"><a name="nocwd"></a><span class="nroffip">nocwd</span> <p class="level2">curl does no CWD at all. curl will do SIZE, RETR, STOR etc and give a full path to the server for all these commands. This is the fastest behavior. <p class="level1"><a name="singlecwd"></a><span class="nroffip">singlecwd</span> <p class="level2">curl does one CWD with the full target directory and then operates on the file "normally" (like in the multicwd case). This is somewhat more standards compliant than 'nocwd' but without the full penalty of 'multicwd'. <p class="level1"><p class="level0"><a name="--ftp-pasv"></a><span class="nroffip">--ftp-pasv</span> <p class="level1">(FTP) Use PASV when transferring. PASV is the internal default behavior, but using this option can be used to override a previous --ftp-port option. (Added in 7.11.0) <p class="level1">If this option is used several times, the following occurrences make no difference. <p class="level1"><p class="level0"><a name="--ftp-alternative-to-user"></a><span class="nroffip">--ftp-alternative-to-user <command></span> <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" will tell the server to retrieve the username from the certificate. (Added in 7.15.5)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -