咨询热线:4006-75-4006

售前:9:00-23:30    备案:9:00-18:00    技术:7*24h

curl 常用命令

2020-10-14 09:42:05 257次
# -v 参数输出通信的整个过程,用于调试

curl -v -I  http://www.landui.com

# -x 指定http代理访问

curl -I www.landui.com -x 127.0.0.1:80

# -e 参数用来设置 HTTP 的标头Referer

curl -I  https://www.landui.com  -e "http://www.landui.com/"

# -A 设置user-agent

curl -I https://www.landui.com -A "Baiduspider"

# -L 参数会让 HTTP 请求跟随服务器的重定向。curl默认不跟随重定向

curl -L -I  http://www.landui.com

# -k 参数指定跳过SSL检测,不会检查服务器的SSL证书是否正确

curl -k  http://www.landui.com

# --limit-rate用来限制 HTTP 请求和回应的带宽,模拟慢网速的环境

curl --limit-rate 200k  http://www.landui.com

# -s 参数将不输出错误和进度信息。

curl -s https://www.landui.com

#-S 参数指定只输出错误信息,通常与-s一起使用。

curl -S -s -o /dev/null  http://www.landui.com

# -R :Set the remote file's time on the local output

curl -OR  http://www.landui.com/1.html

# -X 参数指定 HTTP 请求的方法

curl -X POST  http://www.landui.com

# 不需要修改/etc/hosts,curl直接解析ip请求域名

curl --resolve www.landui.com:80:127.0.0.1 http://www.landui.com/

curl --resolve www.landui.com:443:127.0.0.1 https://www.landui.com/


首页
最新活动
个人中心