--ciphers <list of ciphers> --compressed
(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. --connect-timeout <seconds>
设置与server建立链接的超时时间,一旦与server建立连接成功,则此选项便不再使用
-c/--cookie-jar <file name> -C/--continue-at <offset>
续传相关
--create-dirs
--crlf
(FTP)在上产过程中将LF转换成CRLF
--crlfile <file>
(HTTPS/FTPS) -d/--data <data>
(HTTP)通过POST请求向server发送指定的data。这和在浏览器填写一个表单并点击提交按钮的过程相同。This will cause curl to pass the data to the server using the content-type application/x-www-form-urlencoded(注意和 -F/--form 的区别)
-d/--data和--data-ascii一样,如果想以纯二进制POST 数据(To post data purely binary),应该使用--data-binary选项;想以URL-encode方式POST数据,使用--data-urlencode。
如果这些选项在一个curl命令里出现多次,data片段会被用‘&’组合成一串data,例如‘-d name=daniel -d skill=lousy’会被自动组合为'name=daniel&skill=lousy' 的形式。
如果数据部分以 @ 开头,则剩余部分应该是一个文件,curl从该文件读取内容传递给server; 如果数据部分以 - 开头,表示希望从stdin读取数据。文件的内容必须是经过URL-encoded编码的,也可以指定多个文件。
--data-binary <data>
--data-urlencode <data>
--delegation
--digest
(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 -u/--user option to set user name and password. See also --ntlm, --negotiate and --anyauth for related options.
--disable-eprt
-D/--dump-header <file>
将协议头信息(protocol headers)写进指定的文件 -e/--referer <URL>
(HTTP)发送"Referer Page"信息到server。可以用来欺骗server绕过一些简单的防盗链设置。同样可以通过-H/--header选项设置。当使用-L/--location时可以将该选项参数设为”;auto“。自动将--referer 设置为前一个url。
-F/--form <name=content>
(HTTP)让curl仿真完成浏览器端填写表单并提交的过程。This causes curl to POST data using the Content-Type multipart/form-data(注意和 -d/--data <data> 的区别)。如果要将'内容'部分指定为文件,在文件前面加上 @;如果仅要读出文件里的内容,在文件前面加 < 。@和<的区别在于:
如果想从stdin读取content,用 -
也可以通过’type=‘告诉curl以何种Content-Type post,如下
curl -F "web=@index.html;type=text/html" url.com
--form-string <name=string>
-g/--globoff
-G/--get -H/--header <header>
(HTTP)请求页面是额外的请求头信息。可以设置任意数量的额外请求头信息,如果你设置的头信息的名称和curl默认使用的头信息相同,则你额外设置的头信息会覆盖curl默认会使用的。若想删除某个请求头信息,则将其值指定为空即可,例如 -H "Host:"
例如:开启gzip传输
curl -I http://www.sina.com.cn/ -H Accept-Encoding:gzip,defalte
-i/--include
在输出中包含响应头信息
--interface <name>
指定走哪个网络接口 -I/--head
(HTTP/FTP/FILE)仅取回请求文件的头信息
-j/--junk-session-cookies
(HTTP) When curl is told to read cookies from a given file, this option will make it discard all "session cookies". This will basically have the same effect as if a new session is started. Typical browsers always discard session cookies when they’re closed down.
-k/--insecure
(SSL)
--keepalive-time <seconds>
keepalived超时时间
--key <key>
(SSL/SSH)
--key-type <type>
(SSL) -K/--config <config file>
指定配置文件。可以讲curl的参数写进文件,每个选项及其参数一行,分隔符为:空格、冒号、等号(推荐用 等号);若参数中包含空格,则放到引号中;以 # 注释一行;长选项在config文件里不需要加--;
100-199,500-599 指定两个分开的100字节
--raw
该选项禁用所有的’http内部解码‘(internal HTTP decoding of content)或’传输过程编码(transfer encodings)‘,以为改变的形式传递内容。
-R/--remote-time
When used, this will make libcurl attempt to figure out the timestamp of the remote file, and if that is available make the local file get that same timestamp. --retry <num>
重试次数 --retry-delay <seconds>
重试间隔
--retry-max-time <seconds> -s/--silent
安静模式不显示进度条和错误信息 -S/--show-error
和-s一起用,只输出错误信息 --tcp-nodelay
开启内核的TCP_NODELAY。 -u/--user <user:password>
指定用户名密码
-U/--proxy-user <user:password>
指定代理需要的用户名密码