curl and wget

1. curl 

-s silent   -v 详细输出   -L  302 追踪

-w  自定义输出格式  如 

 -w %{http_code}   curl -o /dev/null -s -w "time_connect: %{time_connect}\ntime_starttransfer: %{time_starttransfer}\ntime_total: %{time_total}\n

-x 代理

-I 只输出请求header , -i  include  请求内容和  header

-A  自定义user-agent

curl -A "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"

-H  自定义header

默认请求内容输出到屏幕 , -o 输出重定向, 可以直接请求https

-d POST 请求发送 json 数据, 如

curl -H "Content-type:Application/json" -d '{"hostname": "CNC-WV-b-D40", "result": {"hostname": "hostname", "network": [{"DEVICE": "bond0", "IPADDR": "1.1.1.1"}, {"DEVICE": "bond1", "IPADDR": "10.11.100.32"}], "service_tag": "060580bD40"}}'  "url"

https 访问加代理方式  --resolv blog.csdn.net:443:47.95.47.253

猜你喜欢

转载自www.cnblogs.com/brucewhite/p/11051643.html