1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# 添加 host 头
curl -H "Host: minio.services.wait" http://10.2.1.75:80/static/css/style.css
# 修改 agent 和 xff
curl -i --user-agent myagent \
-H "X-Forwarded-For: 1.1.1.1, 2.2.2.2" \
-H "Host: www.baidu.com" \
http://10.1.2.1:18001/
# 请求 ipv6 服务
curl -6 -g http://[2409:8081:1120:6010:7002::12c]:17101
curl -6 -g -k https://[2409:8081:1120:6010:7002::20]:443/services/LoginForWap?wsdl
# socket5
curl --socks5 127.0.0.1:15733 http://myip.ipip.net
curl --socks5-h 192.168.5.9:20323 http://10.10.55.4:8000/
# http 获取返回码
curl -sL -w "%{http_code}\\n" www.baidu.com -o /dev/null
curl -i -s -o /dev/null -w "%{http_code}\n" http://blog.services.wait
curl -s --connect-timeout 5 -o /dev/null -w "%{http_code}" "https://www.baidu.com"
# GET 请求多条参数的情况下对中文进行 urlencode 转码
curl -G --data-urlencode 'phone=1111111,222222' \
--data-urlencode 'body= 【服务器故障】 10.26.2.20 故障, 请及时检查处理 ' \
'http://10.1.2.1:9002/api/v1/sms/send'
|