更新 'linux基础/curl只打印状态信息.txt'
This commit is contained in:
parent
3081a0dce6
commit
5afce7de88
1 changed files with 0 additions and 0 deletions
33
linux基础/curl只打印状态信息.txt
Normal file
33
linux基础/curl只打印状态信息.txt
Normal file
|
@ -0,0 +1,33 @@
|
|||
curl -I -m 10 -o /dev/null -s -w %{http_code} www.baidu.com
|
||||
|
||||
-I 仅测试HTTP头
|
||||
-m 10 最多查询10s
|
||||
-o /dev/null 屏蔽原有输出信息
|
||||
-s silent 模式,不输出任何东西
|
||||
-w %{http_code} 控制额外输出
|
||||
|
||||
|
||||
常用参数:
|
||||
-v/--verbose 小写的v参数,用于打印更多信息,包括发送的请求信息,这在调试脚本是特别有用。
|
||||
|
||||
-m/--max-time <seconds> 指定处理的最大时长
|
||||
|
||||
-H/--header <header> 指定请求头参数
|
||||
|
||||
-s/--slient 减少输出的信息,比如进度
|
||||
|
||||
--connect-timeout <seconds> 指定尝试连接的最大时长
|
||||
|
||||
-x/--proxy <proxyhost[:port]> 指定代理服务器地址和端口,端口默认为1080
|
||||
|
||||
-T/--upload-file <file> 指定上传文件路径
|
||||
|
||||
-o/--output <file> 指定输出文件名称
|
||||
|
||||
-d/--data/--data-ascii <data> 指定POST的内容
|
||||
|
||||
--retry <num> 指定重试次数
|
||||
|
||||
-e/--referer <URL> 指定引用地址
|
||||
|
||||
-I/--head 仅返回头部信息,使用HEAD请求
|
Loading…
Add table
Add a link
Reference in a new issue