⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 curl.html

📁 功能最强大的网络爬虫,希望大家好好学习啊,好好研究啊
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<p class="level0"><a name="--ftp-skip-pasv-ip"></a><span class="nroffip">--ftp-skip-pasv-ip</span> <p class="level1">(FTP) Tell curl to not use the IP address the server suggests in its response to curl's PASV command when curl connects the data connection. Instead curl will re-use the same IP address it already uses for the control connection. (Added in 7.14.2) <p class="level1">This option has no effect if PORT, EPRT or EPSV is used instead of PASV. <p class="level1">If this option is used twice, the second will again use the server's suggested address. <p class="level0"><a name="--ftp-ssl"></a><span class="nroffip">--ftp-ssl</span> <p class="level1">(FTP) Try to use SSL/TLS for the FTP connection. Reverts to a non-secure connection if the server doesn't support SSL/TLS. (Added in 7.11.0) <p class="level1">If this option is used twice, the second will again disable this. <p class="level0"><a name="--ftp-ssl-reqd"></a><span class="nroffip">--ftp-ssl-reqd</span> <p class="level1">(FTP) Require SSL/TLS for the FTP connection. Terminates the connection if the server doesn't support SSL/TLS. (Added in 7.15.5) <p class="level1">If this option is used twice, the second will again disable this. <p class="level0"><a name="-F--form"></a><span class="nroffip">-F/--form &lt;name=content&gt;</span> <p class="level1">(HTTP) This lets curl emulate a filled in form in which a user has pressed the submit button. This causes curl to POST data using the Content-Type multipart/form-data according to RFC1867. This enables uploading of binary files etc. To force the 'content' part to be a file, prefix the file name with an @ sign. To just get the content part from a file, prefix the file name with the letter &lt;. The difference between @ and &lt; is then that @ makes a file get attached in the post as a file upload, while the &lt; makes a text field and just get the contents for that text field from a file. <p class="level1">Example, to send your password file to the server, where 'password' is the name of the form-field to which /etc/passwd will be the input: <p class="level1"><span Class="bold">curl</span> -F password=@/etc/passwd www.mypasswords.com <p class="level1">To read the file's content from stdin instead of a file, use - where the file name should've been. This goes for both @ and &lt; constructs. <p class="level1">You can also tell curl what Content-Type to use by using 'type=', in a manner similar to: <p class="level1"><span Class="bold">curl</span> -F "web=@index.html;type=text/html" url.com <p class="level1">or <p class="level1"><span Class="bold">curl</span> -F "name=daniel;type=text/foo" url.com <p class="level1">You can also explicitly change the name field of an file upload part by setting filename=, like this: <p class="level1"><span Class="bold">curl</span> -F "file=@localfile;filename=nameinpost" url.com <p class="level1">See further examples and details in the MANUAL. <p class="level1">This option can be used multiple times. <p class="level0"><a name="--form-string"></a><span class="nroffip">--form-string &lt;name=string&gt;</span> <p class="level1">(HTTP) Similar to <span Class="emphasis">--form</span> except that the value string for the named parameter is used literally. Leading '@' and '&lt;' characters, and the ';type=' string in the value have no special meaning. Use this in preference to <span Class="emphasis">--form</span> if there's any possibility that the string value may accidentally trigger the '@' or '&lt;' features of <span Class="emphasis">--form</span>. <p class="level0"><a name="-g--globoff"></a><span class="nroffip">-g/--globoff</span> <p class="level1">This option switches off the "URL globbing parser". When you set this option, you can specify URLs that contain the letters {}[] without having them being interpreted by curl itself. Note that these letters are not normal legal URL contents but they should be encoded according to the URI standard. <p class="level0"><a name="-G--get"></a><span class="nroffip">-G/--get</span> <p class="level1">When used, this option will make all data specified with <a class="emphasis" href="#-d--data">-d/--data</a> or <a class="emphasis" href="#--data-binary">--data-binary</a> to be used in a HTTP GET request instead of the POST request that otherwise would be used. The data will be appended to the URL with a '?'  separator. <p class="level1">If used in combination with -I, the POST data will instead be appended to the URL with a HEAD request. <p class="level1">If this option is used several times, the following occurrences make no difference. <p class="level0"><a name="-h--help"></a><span class="nroffip">-h/--help</span> <p class="level1">Usage help. <p class="level0"><a name="-H--header"></a><span class="nroffip">-H/--header &lt;header&gt;</span> <p class="level1">(HTTP) Extra header to use when getting a web page. You may specify any number of extra headers. Note that if you should add a custom header that has the same name as one of the internal ones curl would use, your externally set header will be used instead of the internal one. This allows you to make even trickier stuff than curl would normally do. You should not replace internally set headers without knowing perfectly well what you're doing. Replacing an internal header with one without content on the right side of the colon will prevent that header from appearing. <p class="level1">curl will make sure that each header you add/replace get 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 will only mess things up for you. <p class="level1">See also the <a class="emphasis" href="#-A--user-agent">-A/--user-agent</a> and <a class="emphasis" href="#-e--referer">-e/--referer</a> options. <p class="level1">This option can be used multiple times to add/replace/remove multiple headers. <p class="level0"><a name="--ignore-content-length"></a><span class="nroffip">--ignore-content-length</span> <p class="level1">(HTTP) Ignore the Content-Length header. This is particularly useful for servers running Apache 1.x, which will report incorrect Content-Length for files larger than 2 gigabytes. <p class="level0"><a name="-i--include"></a><span class="nroffip">-i/--include</span> <p class="level1">(HTTP) Include the HTTP-header in the output. The HTTP-header includes things like server-name, date of the document, HTTP-version and more... <p class="level1">If this option is used twice, the second will again disable header include. <p class="level0"><a name="--interface"></a><span class="nroffip">--interface &lt;name&gt;</span> <p class="level1">Perform an operation using a specified interface. You can enter interface name, IP address or host name. An example could look like: <p class="level1">&nbsp;curl --interface eth0:1 <a href="http://www.netscape.com/">http://www.netscape.com/</a> <p class="level1">If this option is used several times, the last one will be used. <p class="level0"><a name="-I--head"></a><span class="nroffip">-I/--head</span> <p class="level1">(HTTP/FTP/FILE) Fetch the HTTP-header only! HTTP-servers feature the command HEAD which this uses to get nothing but the header of a document. When used on a FTP or FILE file, curl displays the file size and last modification time only. <p class="level1">If this option is used twice, the second will again disable header only. <p class="level0"><a name="-j--junk-session-cookies"></a><span class="nroffip">-j/--junk-session-cookies</span> <p class="level1">(HTTP) When curl is told to read cookies from a given file, this option will make it discard all "session cookies". This will basically have the same effect as if a new session is started. Typical browsers always discard session cookies when they're closed down. <p class="level1">If this option is used several times, each occurrence will toggle this on/off. <p class="level0"><a name="-k--insecure"></a><span class="nroffip">-k/--insecure</span> <p class="level1">(SSL) This option explicitly allows curl to perform "insecure" SSL connections and transfers. All SSL connections are attempted to be made secure by using the CA certificate bundle installed by default. This makes all connections considered "insecure" to fail unless <a class="emphasis" href="#-k--insecure">-k/--insecure</a> is used. <p class="level1">If this option is used twice, the second time will again disable it. <p class="level0"><a name="--key"></a><span class="nroffip">--key &lt;key&gt;</span> <p class="level1">(SSL) Private key file name. Allows you to provide your private key in this separate file. <p class="level1">If this option is used several times, the last one will be used. <p class="level0"><a name="--key-type"></a><span class="nroffip">--key-type &lt;type&gt;</span> <p class="level1">(SSL) 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. <p class="level1">If this option is used several times, the last one will be used. <p class="level0"><a name="--krb4"></a><span class="nroffip">--krb4 &lt;level&gt;</span> <p class="level1">(FTP) Enable kerberos4 authentication and use. The level must be entered and should be one of 'clear', 'safe', 'confidential' or 'private'. Should you use a level that is not one of these, 'private' will instead be used. <p class="level1">This option requires that the library was built with kerberos4 support. This is not very common. Use <a class="emphasis" href="#-V--version">-V/--version</a> to see if your curl supports it. <p class="level1">If this option is used several times, the last one will be used. <p class="level0"><a name="-K--config"></a><span class="nroffip">-K/--config &lt;config file&gt;</span> <p class="level1">Specify which config file to read curl arguments from. The config file is a text file in which command line arguments can be written which then will be used as if they were written on the actual command line. Options and their parameters must be specified on the same config file line. If the parameter is to contain white spaces, the parameter must be enclosed within quotes.  If the first column of a config line is a '#' character, the rest of the line will be treated as a comment. <p class="level1">Specify the filename as '-' to make curl read the file from stdin. <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 class="level1">url = "<a href="http://curl.haxx.se/docs/">http://curl.haxx.se/docs/</a>" <p class="level1">This option can be used multiple times. <p class="level1">When curl is invoked, it always (unless <a class="emphasis" href="#-q">-q</a> is used) checks for a default config file and uses it if found. The default config file is checked for in the following places in this order: <p class="level1">1) curl tries to find the "home dir": It first checks for the CURL_HOME and then the HOME environment variables. Failing that, it uses getpwuid() on unix-like systems (which returns the home dir given the current user in your system). On Windows, it then checks for the APPDATA variable, or as a last resort the '%USERPROFILE%Application Data'. <p class="level1">2) On windows, if there is no _curlrc file in the home dir, it checks for one in the same dir the executable curl is placed. On unix-like systems, it will simply try to load .curlrc from the determined home dir. <p class="level0"><a name="--limit-rate"></a><span class="nroffip">--limit-rate &lt;speed&gt;</span> <p class="level1">Specify the maximum transfer rate you want curl to use. This feature is useful if you have a limited pipe and you'd like your transfer not use your entire bandwidth. <p class="level1">The given speed is measured in bytes/second, unless a suffix is appended. Appending 'k' or 'K' will count the number as kilobytes, 'm' or M' makes it megabytes while 'g' or 'G' makes it gigabytes. Examples: 200K, 3m and 1G. <p class="level1">If you are also using the <a class="emphasis" href="#-Y--speed-limit">-Y/--speed-limit</a> option, that option will take precedence and might cripple the rate-limiting slightly, to help keeping the speed-limit logic working. <p class="level1">If this option is used several times, the last one will be used. <p class="level0"><a name="-l--list-only"></a><span class="nroffip">-l/--list-only</span> <p class="level1">(FTP) When listing an FTP directory, this switch forces a name-only view. Especially useful if you want to machine-parse the contents of an FTP directory since the normal directory view doesn't use a standard look or format. <p class="level1">This option causes an FTP NLST command to be sent.  Some FTP servers list only files in their response to NLST; they do not include subdirectories and symbolic links. <p class="level1">If this option is used twice, the second will again disable list only. <p class="level0"><a name="--local-port"></a><span class="nroffip">--local-port &lt;num&gt;[-num]</span> <p class="level1">Set a prefered number or range of local port numbers to use for the connection(s).  Note that port numbers by nature is a scarce resource that will be busy at times so setting this range to something too narrow might cause unnecessary connection setup failures. (Added in 7.15.2) <p class="level0"><a name="-L--location"></a><span class="nroffip">-L/--location</span> <p class="level1">(HTTP/HTTPS) If the server reports that the requested page has moved to a different location (indicated with a Location: header and a 3XX response code) this option will make curl redo the request on the new place. If used together with <a class="emphasis" href="#-i--include">-i/--include</a> or <a class="emphasis" href="#-I--head">-I/--head</a>, headers from all requested pages will be shown. When authentication is used, curl only sends its credentials to the initial host. If a redirect takes curl to a different host, it won't be able to intercept the user+password. See also <a class="emphasis" href="#--location-trusted">--location-trusted</a> on how to change this. You can limit the amount of redirects to follow by using the <a class="emphasis" href="#--max-redirs">--max-redirs</a> option. <p class="level1">If this option is used twice, the second will again disable location following. <p class="level0"><a name="--location-trusted"></a><span class="nroffip">--location-trusted</span> <p class="level1">(HTTP/HTTPS) Like <a class="emphasis" href="#-L--location">-L/--location</a>, but will allow sending the name + password to all hosts that the site may redirect to. This may or may not introduce a security breach if the site redirects you do a site to which you'll send your authentication info (which is plaintext in the case of HTTP Basic authentication). <p class="level1">If this option is used twice, the second will again disable location following. <p class="level0"><a name="--max-filesize"></a><span class="nroffip">--max-filesize &lt;bytes&gt;</span> <p class="level1">Specify the maximum size (in bytes) of a file to download. If the file requested is larger than this value, the transfer will not start and curl will return with exit code 63. 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -